object-traverse
A very simple utility on traversing object graphs using a string.
Changelog
v1.1.1
- added create and push
v1.1.0
- used "." instead of slash
v1.0.2
- added has which check if a path is available by checking if its undefined
How to use
npm install --save-dev object-traverse
If using via normal javascript include, then it is exported as window.objectTraverse.
API
var traverse = ; var graph = field : deep : x : 1 y: 2 field2: deepFunc : {} ;#get a value;#get with a default; #check if something is defined; #sets a value; #helpers;;;; #exec; #delete; #push - add vall to the array will create if it doesn't existstraverse(graph).push('abc',val); #create create the given path if it doesn't exists will skip none object types;; //{ a : { b : { c: {} } }