Function: shortcutNulls()
shortcutNulls<
T>(fn,nullVal?):T
Defined in: packages/core/src/utils/shortcut-nulls.ts:7
Returns a function that returns null if any of the arguments are null or undefined, otherwise it calls the original function. Used in languages with three-valued logic to avoid having to check for nulls in every function.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends (...args) => any | The function type being wrapped. |
Parameters
| Parameter | Type | Default value |
|---|---|---|
fn | T | undefined |
nullVal | any | null |
Returns
T