Scaffold ESM TypeScript rewrite as @larvit/smpp
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Either a failure carrying err, or a success carrying T. Both branches declare every key, so
|
||||
* callers can destructure once and let `if (err)` narrow what is left.
|
||||
*/
|
||||
export type Result<T> =
|
||||
| ({ err: Error } & Partial<Record<keyof T, undefined>>)
|
||||
| ({ err?: undefined } & T);
|
||||
|
||||
export type VoidResult = { err?: Error };
|
||||
Reference in New Issue
Block a user