Updated tests

- Added tests for `str`
- Added tests for `pick`
This commit is contained in:
Josh
2019-01-18 09:20:37 +00:00
committed by GitHub
parent f39b626373
commit 6e2fa1cb73
+9
View File
@@ -47,12 +47,21 @@ var newObj = {
nested: {
value: 'Hi there!'
}
},
breath: {
value: 'Hello'
}
};
var val = dot.pick('some.nested.value', newObj);
console.log(val);
// Set a new value
val = dot.str('breath.value', 'World', newObj);
// Replacing with a new object
val = dot.set('breath', { value: 'Goodbye' }, newObj);
// Pick & Remove the value
val = dot.pick('some.nested.value', newObj, true);