dotfind
v1.0.1
Published
This package is used for searching through javascript objects. Providing a dot notaton of the falttened path and returned is the items within the depths of the object
Downloads
6
Readme
This package is used to search through objects given a dot notation path of the route.
Examples:
const dotfind = require("dotfind");
const obj = {a: 5};
dotfind("a", obj); //5
const dotfind = require("dotfind");
const obj = {a: b: 5};
dotfind("a.b", obj); //5
const dotfind = require("dotfind");
const obj = {"a.b": 5};
dotfind("a.b", obj); //5
const dotfind = require("dotfind");
const obj = {a: {"b.c": 5}};
dotfind("a.b.c", obj); //5
const dotfind = require("dotfind");
const obj = {a: [{b: 5}]};
dotfind("a.0.b", obj); //5
dotfind("a[0].b", obj); //5