Skip to content

roganmelo/get-by-dot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

get-by-dot

🌳 Get value from object using dot path.

NPM version Build StatusCode Coverage 100%ISC LicenseNodeJS

API

import getByDot from 'get-by-dot';

getByDot({}, 'path');

Usage

  import getByDot from 'get-by-dot';

  const obj = {
    a: { b: 'c' },
    b: [{ c: 'a' }]
  };

  getByDot(obj, 'a.b'); // c
  getByDot(obj, 'a'); // { b: 'c' }
  getByDot(obj, 'a.b.c'); // undefined
  getByDot(obj); // { a: { b: 'c' }, b: [{ c: 'a' }] };

About

🌳 Get value from object using dot path.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published