
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
Get or set a value in an object/array using a dot-delimited string or array of keys.
Get or set a value in an object/array using a dot-delimited string or array of keys.
Returns the value in obj corresponding to path. Returns undefined if path does not exist.
obj — An object or array.path — A dot-delimited string of keys, or an array of keys.var obj = {
foo: {
bar: ['Hello', 'World'],
baz: 'Goodbye'
}
};
jaunt.get(obj, 'foo.bar'); //=> ['Hello', 'World']
jaunt.get(obj, 'foo.baz'); //=> 'Goodbye'
jaunt.get(obj, 'foo.bar.0'); //=> 'Hello'
jaunt.get(obj, 'foo.baz.0'); //=> 'Goodbye'
jaunt.get(obj, ['foo', 'bar', 0]); //=> 'World'
jaunt.get(obj, ['foo', 'baz', 0]); //=> 'Goodbye'
jaunt.get(obj, 'invalid'); //=> undefined
There can be a trailing “0” in path if it corresponds to a leaf node. So, in the example above, the paths foo.baz and foo.baz.0 are equivalent.
Sets the element corresponding to path in the obj to the specified val. Any “intermediate” elements in the path will be created if they do not exist. Returns the modified obj.
obj — An object or array.path — A dot-delimited string of keys, or an array of keys.val — The value to set the element corresponding to path.var obj = {
foo: {
bar: ['Hello', 'World']
}
};
jaunt.set(obj, 'foo.bar.0', 'Hola');
/* =>
* {
* foo: {
* bar: ['Hola', 'World']
* }
* }
*/
jaunt.set(obj, 'baz', 'Shiny!');
/* =>
* {
* foo: {
* bar: ['Hola', 'World']
* },
* baz: 'Shiny!'
* }
*/
Install via npm:
$ npm i --save jaunt
Install via bower:
$ bower i --save yuanqing/jaunt
To use Jaunt in the browser, include the minified script in your HTML:
<body>
<!-- ... -->
<script src="path/to/dist/jaunt.min.js"></script>
<script>
// jaunt available here
</script>
</body>
path for the get methodFAQs
Get or set a value in an object/array using a dot-delimited string or array of keys.
The npm package jaunt receives a total of 392 weekly downloads. As such, jaunt popularity was classified as not popular.
We found that jaunt 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.