Skip to content

Add the getKeys method

Compare
Choose a tag to compare
@w3nl w3nl released this 09 Feb 15:37
· 394 commits to master since this release
64f3a1e

Removed node 10 support
Fix the getByKey method for array's
If a key if found in the original object, just return the original value.

original:

{
    a: ['Donatello', 'Michelangelo', 'Raphael', 'Leonardo']
}

before the fix getByKey('a') returns:

{
    0: 'Donatello',
    1: 'Michelangelo',
    2: 'Raphael',
    3: 'Leonardo',
}

now getByKey('a') just returns:

['Donatello', 'Michelangelo', 'Raphael', 'Leonardo']