Commit 85064870 authored by 张九刚's avatar 张九刚

素材分页面

parent 198a0e11
{
"name": "psd-parse-web",
"version": "1.0.4",
"version": "2.0.0",
"main": "src/index.js",
"module": "dist/index.es.js",
"license": "MIT",
......
This diff is collapsed.
/**
* Created by rockyl on 2019-08-10.
*/
async function walkNode(node, callback, includeSelf = false) {
if (includeSelf) {
await callback(node, null);
}
async function walkNode(node, callback) {
if (node.children && node.children.length > 0) {
for (let childNode of node.children) {
await callback(childNode, node);
......@@ -18,7 +12,7 @@ async function walkNode(node, callback, includeSelf = false) {
}
async function walkObject(obj, callback) {
if(typeof obj === "object"){
if (typeof obj === "object") {
for (let key of Object.keys(obj)) {
const value = obj[key];
await callback(key, value, obj);
......@@ -29,7 +23,7 @@ async function walkObject(obj, callback) {
}
}
}
module.exports={
module.exports = {
walkNode,
walkObject
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment