Function
functionalUpdate
(
updater: Updater<TInput, TOutput>,
input: TInput,
)
Source from the content-addressed store, hash-verified
| 96 | export function noop() {} |
| 97 | |
| 98 | export function functionalUpdate<TInput, TOutput>( |
| 99 | updater: Updater<TInput, TOutput>, |
| 100 | input: TInput, |
| 101 | ): TOutput { |
| 102 | return typeof updater === 'function' |
| 103 | ? (updater as (_: TInput) => TOutput)(input) |
| 104 | : updater |
| 105 | } |
| 106 | |
| 107 | export function isValidTimeout(value: unknown): value is number { |
| 108 | return typeof value === 'number' && value >= 0 && value !== Infinity |
Tested by
no test coverage detected