@randajan/jet-core
Advanced tools
Comparing version 2.1.0 to 2.1.2
{ | ||
"name": "@randajan/jet-core", | ||
"version": "2.1.0", | ||
"version": "2.1.2", | ||
"description": "Ecosystem of types and related usefull tools.", | ||
@@ -5,0 +5,0 @@ "repository": "randajan/jet-core", |
@@ -192,4 +192,4 @@ # @randajan/jet-core | ||
### __jet.dig(any, path, def)__ | ||
_Return value from deep nested object_ | ||
### __jet.dig(any, path, reductor)__ | ||
_Exploring nested structure by path_ | ||
@@ -199,10 +199,7 @@ * Arguments | ||
* path: _string or Array (even nested Array)_ | ||
* def: _any_ | ||
* reductor: _function(next, parent, dir+key, dir, key, isEnd)_ | ||
* Return | ||
* find value or def when no value was found | ||
* Example | ||
* jet.dig({foo:["bar"]}, "foo.0") == "bar"; | ||
* jet.dig({foo:["bar"]}, ["foo", 1], "foo") == "foo"; | ||
* result of first iteration of reductor | ||
### __jet.put(any, path, val, force=true)__ | ||
### __jet.digIn(any, path, val, force=true, reductor)__ | ||
_Return value from deep nested object_ | ||
@@ -215,8 +212,22 @@ | ||
* force: _boolean (create path if not exist)_ | ||
* reductor: _function(next, parent, dir+key, dir, key, isEnd)_ | ||
* Return | ||
* any | ||
* Example | ||
* jet.put({}, "foo.0", "bar", true) == {foo:["bar"]}; | ||
* jet.digIn({}, "foo.0", "bar", true) == {foo:["bar"]}; | ||
### __jet.forEach(any, fce, deep, path) / .map(any, fce, deep, path)__ | ||
### __jet.digOut(any, path, def)__ | ||
_Return value from deep nested object_ | ||
* Arguments | ||
* any: _any mapable variable_ | ||
* path: _string or Array (even nested Array)_ | ||
* def: _any_ | ||
* Return | ||
* find value or def when no value was found | ||
* Example | ||
* jet.digOut({foo:["bar"]}, "foo.0") == "bar"; | ||
* jet.digOut({foo:["bar"]}, ["foo", 1], "foo") == "foo"; | ||
### __jet.forEach(any, fce, deep, dir) / .map(any, fce, deep, dir)__ | ||
_Map any mapable object by default: Object, Array, Set, Map, Pool_ | ||
@@ -226,5 +237,5 @@ | ||
* any: _any mapable variable_ | ||
* fce: _function(val, path+key, parent, parentpath) (handler)_ | ||
* fce: _function(val, dir+key, dir, key) (handler)_ | ||
* deep: _boolean or function (true=recursive maping; function=custom recursive maping)_ | ||
* deep: _boolean (recursive maping)_ | ||
* dir: _string (base dir of structure)_ | ||
* Return | ||
@@ -231,0 +242,0 @@ * forEach: _flat array with result from handler function_ |
Sorry, the diff of this file is not supported yet
95593
261