Home > deconstruct-js > maybe
Applies a deconstructor, returns the default value if it fails
Signature:
declare function maybe<T>(inner: Deconstructor<T>, defaultValue: T): Deconstructor<T>;
| Parameter | Type | Description |
|---|---|---|
| inner | Deconstructor<T> |
|
| defaultValue | T |
Returns:
Deconstructor<T>