2.1.2 • Published 5 years ago
object-walk-x v2.1.2
object-walk-x
Walks a given object and invokes a function on each iteration.
module.exports(object, props, supplier, [thisArg])
⏏
This method walks a given object and invokes a function on each iteration.
Kind: Exported function
Param | Type | Description |
---|---|---|
object | * | The object to walk. |
props | function | The function that returns an array of the properties of value to be walked, invoked per iteration. |
supplier | function | The function invoked per iteration. |
thisArg | * | The this binding of supplier . |
Example
const objectWalk from 'object-walk-x';
const subject = {
one: {
a: true,
b: true,
},
two: {
x: true,
y: true,
},
};
objectWalk(subject, Object.keys, function(value, prop, object, depth) {
object[prop + '_renamed'] = value;
delete object[prop];
});
// {
// one_renamed: {
// a_renamed: true,
// b_renamed: true
// },
// two_renamed: {
// x_renamed: true,
// y_renamed: true
// }
// }
module.exports.BREAK
: string
Kind: static property of module.exports
Default: "break"
module.exports.SKIP
: string
Kind: static property of module.exports
Default: "skip"
module.exports.STOP
: string
Kind: static property of module.exports
Default: "stop"
2.1.2
5 years ago
2.1.1
5 years ago
2.1.0
5 years ago
2.0.13
5 years ago
2.0.12
5 years ago
2.0.11
5 years ago
2.0.10
5 years ago
2.0.9
5 years ago
2.0.8
5 years ago
2.0.7
5 years ago
2.0.6
5 years ago
2.0.5
5 years ago
2.0.4
5 years ago
2.0.3
5 years ago
2.0.2
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.7.0
7 years ago
1.6.0
7 years ago
1.5.0
7 years ago
1.3.0
7 years ago
1.2.0
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.8
8 years ago
1.0.7
8 years ago
1.0.6
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago