Skip to content

Latest commit

 

History

History
40 lines (36 loc) · 631 Bytes

README.md

File metadata and controls

40 lines (36 loc) · 631 Bytes

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']