Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'ObjectPath' package for dot (period) support #351

Closed
A-312 opened this issue Jan 1, 2020 · 1 comment · Fixed by A-312/node-blueconfig#1
Closed

Use 'ObjectPath' package for dot (period) support #351

A-312 opened this issue Jan 1, 2020 · 1 comment · Fixed by A-312/node-blueconfig#1

Comments

@A-312
Copy link
Contributor

A-312 commented Jan 1, 2020

I will make a PR to add ObjectPath package like dependencie. This dep looks reliable : https://github.com/mike-marcacci/objectpath/blob/master/test/index.js

Example :

> var ObjectPath = require('objectpath');
undefined
> ObjectPath.parse('a[1].b.c.d["e"]["f"].g');
[ 'a', '1', 'b', 'c', 'd', 'e', 'f', 'g' ]
> ObjectPath.parse('a[1].b.c.d["e"]["www.site.com"].g');
[ 'a', '1', 'b', 'c', 'd', 'e', 'www.site.com', 'g' ]
> ObjectPath.parse('a[1].b.c.d["e"]["www.site\\".com"].g');
[ 'a', '1', 'b', 'c', 'd', 'e', 'www.site".com', 'g' ]
> ObjectPath.parse('a[1].b.c.d[\'e\']["www.site\\".com"].g');
[ 'a', '1', 'b', 'c', 'd', 'e', 'www.site".com', 'g' ]
Similar
#250#271, PR #315
@A-312
Copy link
Contributor Author

A-312 commented Jan 1, 2020

@madarche is it right for you? Can i use ObjectPath?

We will able to do conf.get('a[1].b.c.d["e"]["www.site.com"].g') :)

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 a pull request may close this issue.

1 participant