
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
glob-object
Advanced tools
Filter an object using glob patterns and dot notation.
Install with npm:
$ npm install --save glob-object
var globObject = require('glob-object');
globObject('a.*.f', {a: {b: {c: 'd'}, e: {f: 'g'}}});
//=> { a: { e: { f: 'g' } } }
Given the following object:
var obj = {
a: {
b: {
c: 'd',
e: 'f',
g: 'h',
i: {j: 'k'},
l: {g: 'k'}
},
i: 'j'
}
};
globObject('*', obj);
//=> obj (matches all keys)
globObject('a.*.{c,e}', obj);
//=> {a: {b: {c: 'd', e: 'f'}}}
A single star will match one level of the object:
globObject('a.*.g', obj);
//=> {a: {b: {g: 'h'}}}
A double star will match to any depth (note that the single star in the previous example did not match a.b.l.g
):
globObject('a.**.g', obj);
//=> {a: {b: {g: 'h', l: {g: 'k'}}}}
a.b.c
) to get a nested value from an object. | homepage'a.b.c'
) paths. | homepagePull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on June 19, 2017.
FAQs
Filter an object using glob patterns and dot notation.
We found that glob-object demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.