A simple package for recursion of object.
npm i deepeach
# or
yarn add deepeach
import deepeach from "deepeach";
let mock = {
name: "joenix",
step: 1,
children: {
name: "snoopy",
step: 2,
children: {
name: "kitty",
step: 3
}
},
skills: ["magic", "battleax", "storm"]
};
let result = deepeach(mock, (value, key, path) => {
console.log(`${key}: ${value}`, path);
});
console.log(result);