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