Null safety
Null handling is explicit per operation:
defaultsreplaces onlynullandundefined.- Built-in normalizers return
nullfor nullish, empty, or invalid values. mapEachturns anullorundefinedlist into[].rename,normalize,defaults, andmergeexpect an object; they do not turn a null root value into an object.
Valid falsy values are preserved by defaults:
defaults({count: 10, enabled: true})({count: 0, enabled: false});
// {count: 0, enabled: false}
Normalization is intentionally different because it converts inconsistent external values:
normalize({count: 'number', active: 'boolean'})(
{count: 'not-a-number', active: undefined},
);
// {count: null, active: null}