UNPKG
obj-chain-core
Version:
latest (0.0.9)
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
fluent chaining for obj with dot-prop access
github.com/aretecode/obj-chain
aretecode/obj-chain
obj-chain-core
/
examples
/
simple.js
8 lines
(6 loc)
•
181 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
const
obj =
new
ObjChain(pkg)
const
{forrest} = obj .setIfNotEmpty(
'magical.forrest'
,
'yup'
) .
when
(obj.has(
'jobs'
), () => obj.del(
'jobs'
)) .
set
(
'eh'
,
true
) .
get
(
'magical'
)