Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/theodesp/deep-fallout
Recursively applies a callback to object properties that are functions or objects.
https://github.com/theodesp/deep-fallout
callback deep recursive
Last synced: 20 days ago
JSON representation
Recursively applies a callback to object properties that are functions or objects.
- Host: GitHub
- URL: https://github.com/theodesp/deep-fallout
- Owner: theodesp
- License: mit
- Created: 2017-03-14T16:41:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-01-02T15:49:04.000Z (11 months ago)
- Last Synced: 2024-10-19T09:18:43.950Z (about 1 month ago)
- Topics: callback, deep, recursive
- Language: JavaScript
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# deep-fallout
Recursively applies a callback to object properties that are functions or objects.
# example
``` js
var deepFallout = require('deep-fallout');var Buffer = {
x: 5,
z: 1,
w: {y: 10}
};
deepFallout(Buffer, (obj) => Object.freeze(obj));
Buffer.x = 2;
console.log(Buffer.x);Buffer.w.y = 5;
console.log(Buffer.w.y);
```***
```
$ node example/deep.js
5
10
```# methods
``` js
var deepFallout = require('deep-fallout');
```## deepFallout(obj, callback)
Apply `callback` recursively on all properties of `obj` that are functions or objects.
## deepFallout.makeDeep(callback)
Return a function that accepts an `obj` that partially applies `callback` recursively on all properties of `obj` that are functions or objects.
# tests
Use `yarn` or `npm` to run tests;# license
MIT