obus
is deep object accessor
Usage
var Obus = ;var obus = ;obus;
API
Obus new Obus()
Creates new Obus
object
var obus = ;
* obus.set(String path, * data)
Puts the given object deep into object according to given path
var obus = ;obus;obus; // -> {a: {b: {c: 42}}}
* obus.get(String path[, * defaultValue])
Returns the value placed deep in object according to given path. Returns the second argument if returning value is undefined
var obus = ;obus;obus; // -> {c: 42}obus; // -> 42obus; // -> undefinedobus; // -> 146
Boolean obus.del(String path)
Deletes data from given path. Returns true if the data was deleted else false
var obus = ;obus;obus; // -> trueobus; // -> false
Boolean obus.has(String path)
Checks if any truey (not undefined
) data placed by the given path
var obus = ;obus;obus; // -> trueobus; // -> trueobus; // -> false
* obus.add(String path, * data)
Extends existing data with the given value
var obus = ;obus;obus;obus; // -> {a: {b: 42, c: 42}}
Also
You can use brace accessors if the properties you want is not identifiers.
var obus = ;obus; // error// Obus supports string literalsobus; // doneobus; // done
LICENSE MIT