UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

8 lines (6 loc) 214 B
function isFalsy(input) { return input === undefined || input === null || Number.isNaN(input) === true } export function defaultTo(defaultArgument) { return input => isFalsy(input) ? defaultArgument : input }