sindresorhus / dot-prop

Get, set, or delete a property from a nested object using a dot path
MIT License
812 stars 69 forks source link

Add `escapePath()` #90

Closed Richienb closed 2 years ago

Richienb commented 2 years ago
import {getProperty, escapePath} from 'dot-prop';

const object = {
    foo: {
        bar: ['πŸ‘ΈπŸ» You found me Mario!'],
    },
    'foo.bar[0]' : 'πŸ„ The princess is in another castle!',
};
const escapedPath = escapePath('foo.bar[0]');

console.log(getProperty(object, escapedPath));
//=> 'πŸ„ The princess is in another castle!'

Fixes #83

sindresorhus commented 2 years ago

Do you plan any more work after this PR or should I release it then?

Richienb commented 2 years ago

Do you plan any more work after this PR or should I release it then?

Last one: #91