Transforms null to nullValue, and applies otherTransform to all other values.
null
nullValue
otherTransform
import * as G from "flurp/guard";import * as L from "flurp/logic";const nullToEmpty = G.ifIsNull([], L.identity);nullToEmpty(null); // []nullToEmpty([3, 4, 5]); // [3, 4, 5]
Transforms
null
tonullValue
, and appliesotherTransform
to all other values.Example