1.0.1 • Published 6 years ago

dotfind v1.0.1

Weekly downloads
198
License
MIT
Repository
github
Last release
6 years ago

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
1.0.1

6 years ago

1.0.0

6 years ago