Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "diver", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Deep access to nested object values", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# diver | ||
## Install | ||
``` | ||
npm install diver | ||
``` | ||
## API | ||
### get | ||
``diver.get(object, keys, [defaultValue])`` | ||
### set | ||
``diver.set(object, keys, value)`` | ||
## Example | ||
``` | ||
var swamp = { | ||
'a': { | ||
'b': 123, | ||
't': { | ||
'c': 89, | ||
'v': { | ||
'x': 'Test' | ||
} | ||
} | ||
} | ||
}; | ||
diver.get(swamp, ['a', 't', 'v', 'x'], 'Default value'); | ||
diver.set(swamp, ['z', 't', 'v', 'x'], 'test'); | ||
``` |
3352
36