Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psd-parse-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
psd-parse-web
Commits
85064870
Commit
85064870
authored
Feb 02, 2021
by
张九刚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
素材分页面
parent
198a0e11
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
139 additions
and
228 deletions
+139
-228
package.json
package.json
+1
-1
compilelocal.js
src/compilelocal.js
+135
-218
utils.js
src/utils.js
+3
-9
No files found.
package.json
View file @
85064870
{
{
"name"
:
"psd-parse-web"
,
"name"
:
"psd-parse-web"
,
"version"
:
"
1.0.4
"
,
"version"
:
"
2.0.0
"
,
"main"
:
"src/index.js"
,
"main"
:
"src/index.js"
,
"module"
:
"dist/index.es.js"
,
"module"
:
"dist/index.es.js"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
...
...
src/compilelocal.js
View file @
85064870
This diff is collapsed.
Click to expand it.
src/utils.js
View file @
85064870
/**
* Created by rockyl on 2019-08-10.
*/
async
function
walkNode
(
node
,
callback
,
includeSelf
=
false
)
{
async
function
walkNode
(
node
,
callback
)
{
if
(
includeSelf
)
{
await
callback
(
node
,
null
);
}
if
(
node
.
children
&&
node
.
children
.
length
>
0
)
{
if
(
node
.
children
&&
node
.
children
.
length
>
0
)
{
for
(
let
childNode
of
node
.
children
)
{
for
(
let
childNode
of
node
.
children
)
{
await
callback
(
childNode
,
node
);
await
callback
(
childNode
,
node
);
...
@@ -18,7 +12,7 @@ async function walkNode(node, callback, includeSelf = false) {
...
@@ -18,7 +12,7 @@ async function walkNode(node, callback, includeSelf = false) {
}
}
async
function
walkObject
(
obj
,
callback
)
{
async
function
walkObject
(
obj
,
callback
)
{
if
(
typeof
obj
===
"object"
)
{
if
(
typeof
obj
===
"object"
)
{
for
(
let
key
of
Object
.
keys
(
obj
))
{
for
(
let
key
of
Object
.
keys
(
obj
))
{
const
value
=
obj
[
key
];
const
value
=
obj
[
key
];
await
callback
(
key
,
value
,
obj
);
await
callback
(
key
,
value
,
obj
);
...
@@ -29,7 +23,7 @@ async function walkObject(obj, callback) {
...
@@ -29,7 +23,7 @@ async function walkObject(obj, callback) {
}
}
}
}
}
}
module
.
exports
=
{
module
.
exports
=
{
walkNode
,
walkNode
,
walkObject
walkObject
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment