Skip to content

Add escapePath()#90

Merged
sindresorhus merged 6 commits intosindresorhus:mainfrom
Richienb:escape-path
Jan 22, 2022
Merged

Add escapePath()#90
sindresorhus merged 6 commits intosindresorhus:mainfrom
Richienb:escape-path

Conversation

@Richienb
Copy link
Contributor

@Richienb Richienb commented Jan 22, 2022

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

Richienb and others added 2 commits January 22, 2022 17:24
Fixes sindresorhus#83

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@sindresorhus
Copy link
Owner

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

Richienb and others added 2 commits January 22, 2022 19:35
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@Richienb
Copy link
Contributor Author

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

Last one: #91

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@Richienb Richienb requested a review from sindresorhus January 22, 2022 07:09
@sindresorhus sindresorhus merged commit 0505e98 into sindresorhus:main Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

escape()

2 participants