getdeep

1.0.4 • Public • Published

getdeep

like .get but goes all the way down

use

var getDeep = require('getdeep');

works on objects like normal

getDeep('en', {en: 'the title', fr: 'le titre'}); // 'the title'

get deeper

getDeep('en', {
    title: {
        en: 'The title',
        fr: 'Le title'
    },
    body: {
        en: 'The body',
        fr: 'le texte'
    }
}); // { title: 'The title', body: 'The body' }

get arrays

getDeep('en', [
    {
        en: 'item 1',
        fr: 'point 1'
    },
    {
        en: 'item 2',
        fr: 'point 2'
    }
]); // ['item 1','item 2']

Readme

Keywords

Package Sidebar

Install

npm i getdeep

Weekly Downloads

0

Version

1.0.4

License

ISC

Last publish

Collaborators

  • lukechinworth