https://github.com/threepointone/at
at(o, path) and setAt(o, path, value)
https://github.com/threepointone/at
Last synced: 2 months ago
JSON representation
at(o, path) and setAt(o, path, value)
- Host: GitHub
- URL: https://github.com/threepointone/at
- Owner: threepointone
- Created: 2013-01-16T14:29:36.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-24T09:16:26.000Z (over 12 years ago)
- Last Synced: 2025-01-25T08:11:41.990Z (4 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# at
safe object access
## Installation
$ component install threepointone/at
## API
```js
var at = require('at').at;
var setAt = require('at').setAt;var o = {
a:{
b:1
}
};console.log(at(o, 'a.b'));
// 1console.log(at(o, 'a.b.c'));
//undefinedsetAt(o, 'a.b.c.d.e', 'magic');
console.log(o.a.b.c.d);
// { e:'magic' }```
## Tests (pending)
install dependencies -
```
npm install
```
then
```
npm test
```
## License
MIT