Dynamically utility for combining different types of values into a single value.
Package Exports
xuxi
xuxi/package.json
Readme
XUXI
Usages
ocx
import x from'xuxi';
x.ocx({ a:1},[{ b:2},{ d:4, e:null},{ f:undefined, g:NaN}],()=>({ c:3}),
key => key?.a &&{'key?.a': key.a ===1},{},0,// will be ignored'string',// will be ignorednull,// will be ignoredNaN// will be ignored);// { a: 1, b: 2, d: 4, c: 3, 'key?.a': true }
object
.raw()
A version of ocx that performs deep merging without removing falsy values.
.preserve()
A version of ocx that performs a deep join without overwriting the value at the first key, only change the value if it does not exist and without removing falsy values.