mixy
Sugar methods to manipulate objects.
Methods
var mixy = // actually `mix === mixy`var mix = mixymix
r = mix(r, ...sources)
Mix own properties from all sources
into the receiver object r
.
var o = x: 1 // o == { x: 4, y: 3 }
r = fill(r, defaults)
Mix own properties from defaults
into the receiver object r
, except those r
already owns.
var o = x: 1 y: 2 z: null w: undefined // o == { x: 1, y: 2, z: null, w: undefined, a: null, b: undefined }
o = pick(keys, ...sources)
Pick properties specified in keys
from sources
to create the returned object.
var o = // o == { x: 3, y: 2 } o = // o == { x: 3 }
o = exclude(keys, ...sources)
Pick properties except thos specified in keys
from sources
to create the returned object.
var o = // o == { x: 3 } o = // o == { z: 4 }
o = del(keys, target)
Delete keys
from target
,
and return a new object containing those deleted key-value
s.
If none is deleted, null
will be returned.
var o = // o == { y: 2 } var o = // o == null o = // o == { x: 1, y: 2 }