meaningPromiseOrThrow
Generates a .then() interceptor that avoids any empty data by throwing an error.
| Input | Result |
|---|---|
any other value, 0, boolean | passes through unchanged |
"", null, undefined, [], {} | throws |
Available since v1.0.1
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
error | string | The error message thrown if the data is null, undefined, or empty ("", [], {}). |
Returns
Section titled “Returns”(data: T) => T | never — A .then() interceptor: returns data unchanged, or throws error.
