Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-pack
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
劳工
zeroing-pack
Commits
964231cd
Commit
964231cd
authored
Dec 05, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打包删除多余数据
parent
aa460ade
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
19 deletions
+99
-19
index.es.js
dist/index.es.js
+24
-4
index.es.js.map
dist/index.es.js.map
+1
-1
index.js
dist/index.js
+24
-4
index.js.map
dist/index.js.map
+1
-1
index.umd.js
dist/index.umd.js
+24
-4
index.umd.js.map
dist/index.umd.js.map
+1
-1
index.js
src/index.js
+24
-4
No files found.
dist/index.es.js
View file @
964231cd
...
@@ -235,18 +235,20 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
...
@@ -235,18 +235,20 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
let
newData
=
{};
let
newData
=
{};
newData
.
options
=
data
.
options
;
newData
.
options
=
data
.
options
;
delete
newData
.
options
.
tpl
;
newData
.
views
=
data
.
views
;
newData
.
views
=
data
.
views
;
newData
.
assets
=
data
.
assets
;
newData
.
assets
=
data
.
assets
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
processes
=
data
.
processes
;
newData
.
processes
=
data
.
processes
;
delete
newData
.
options
.
tpl
;
deleteUnusedData
(
newData
.
processes
);
console
.
log
(
TAG
,
'start'
);
console
.
log
(
TAG
,
'start'
);
/*=====START process =====*/
/*=====START process =====*/
console
.
log
(
TAG
,
'start process'
);
console
.
log
(
TAG
,
'start process'
);
let
processIDs
=
[];
let
processIDs
=
[];
findDepPidsBat
(
processIDs
,
d
ata
.
processes
);
findDepPidsBat
(
processIDs
,
newD
ata
.
processes
);
let
builtinProcesses
=
newData
.
builtinProcesses
=
[];
let
builtinProcesses
=
newData
.
builtinProcesses
=
[];
let
bProcessIDs
=
processIDs
;
let
bProcessIDs
=
processIDs
;
...
@@ -264,7 +266,7 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
...
@@ -264,7 +266,7 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
}
}
}
}
for
(
let
process
of
d
ata
.
processes
)
{
for
(
let
process
of
newD
ata
.
processes
)
{
processManager
.
deal
(
process
);
processManager
.
deal
(
process
);
}
}
...
@@ -343,6 +345,25 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
...
@@ -343,6 +345,25 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
};
};
}
}
const
unusedFields
=
[
'design'
];
function
deleteUnusedData
(
processes
){
for
(
let
process
of
processes
){
if
(
process
.
sub
){
for
(
let
uuid
in
process
.
sub
){
let
subProcess
=
process
.
sub
[
uuid
];
for
(
let
field
of
unusedFields
){
if
(
subProcess
.
hasOwnProperty
(
field
)){
delete
subProcess
[
field
];
}
}
}
}
if
(
process
.
metas
&&
process
.
metas
.
length
>
0
){
deleteUnusedData
(
process
.
metas
);
}
}
}
function
findDepPids
(
list
,
process
)
{
function
findDepPids
(
list
,
process
)
{
if
(
process
.
sub
)
{
if
(
process
.
sub
)
{
for
(
let
key
in
process
.
sub
)
{
for
(
let
key
in
process
.
sub
)
{
...
@@ -369,7 +390,6 @@ async function addBuiltinProcesses(list, ids, getProcesses) {
...
@@ -369,7 +390,6 @@ async function addBuiltinProcesses(list, ids, getProcesses) {
list
.
push
(
process
);
list
.
push
(
process
);
findDepPids
(
newPids
,
process
);
findDepPids
(
newPids
,
process
);
}
}
//console.log('processes:', data.processes);
}
}
return
newPids
;
return
newPids
;
}
}
...
...
dist/index.es.js.map
View file @
964231cd
This diff is collapsed.
Click to expand it.
dist/index.js
View file @
964231cd
...
@@ -241,18 +241,20 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
...
@@ -241,18 +241,20 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
let
newData
=
{};
let
newData
=
{};
newData
.
options
=
data
.
options
;
newData
.
options
=
data
.
options
;
delete
newData
.
options
.
tpl
;
newData
.
views
=
data
.
views
;
newData
.
views
=
data
.
views
;
newData
.
assets
=
data
.
assets
;
newData
.
assets
=
data
.
assets
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
processes
=
data
.
processes
;
newData
.
processes
=
data
.
processes
;
delete
newData
.
options
.
tpl
;
deleteUnusedData
(
newData
.
processes
);
console
.
log
(
TAG
,
'start'
);
console
.
log
(
TAG
,
'start'
);
/*=====START process =====*/
/*=====START process =====*/
console
.
log
(
TAG
,
'start process'
);
console
.
log
(
TAG
,
'start process'
);
let
processIDs
=
[];
let
processIDs
=
[];
findDepPidsBat
(
processIDs
,
d
ata
.
processes
);
findDepPidsBat
(
processIDs
,
newD
ata
.
processes
);
let
builtinProcesses
=
newData
.
builtinProcesses
=
[];
let
builtinProcesses
=
newData
.
builtinProcesses
=
[];
let
bProcessIDs
=
processIDs
;
let
bProcessIDs
=
processIDs
;
...
@@ -270,7 +272,7 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
...
@@ -270,7 +272,7 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
}
}
}
}
for
(
let
process
of
d
ata
.
processes
)
{
for
(
let
process
of
newD
ata
.
processes
)
{
processManager
.
deal
(
process
);
processManager
.
deal
(
process
);
}
}
...
@@ -349,6 +351,25 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
...
@@ -349,6 +351,25 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
};
};
}
}
const
unusedFields
=
[
'design'
];
function
deleteUnusedData
(
processes
){
for
(
let
process
of
processes
){
if
(
process
.
sub
){
for
(
let
uuid
in
process
.
sub
){
let
subProcess
=
process
.
sub
[
uuid
];
for
(
let
field
of
unusedFields
){
if
(
subProcess
.
hasOwnProperty
(
field
)){
delete
subProcess
[
field
];
}
}
}
}
if
(
process
.
metas
&&
process
.
metas
.
length
>
0
){
deleteUnusedData
(
process
.
metas
);
}
}
}
function
findDepPids
(
list
,
process
)
{
function
findDepPids
(
list
,
process
)
{
if
(
process
.
sub
)
{
if
(
process
.
sub
)
{
for
(
let
key
in
process
.
sub
)
{
for
(
let
key
in
process
.
sub
)
{
...
@@ -375,7 +396,6 @@ async function addBuiltinProcesses(list, ids, getProcesses) {
...
@@ -375,7 +396,6 @@ async function addBuiltinProcesses(list, ids, getProcesses) {
list
.
push
(
process
);
list
.
push
(
process
);
findDepPids
(
newPids
,
process
);
findDepPids
(
newPids
,
process
);
}
}
//console.log('processes:', data.processes);
}
}
return
newPids
;
return
newPids
;
}
}
...
...
dist/index.js.map
View file @
964231cd
This diff is collapsed.
Click to expand it.
dist/index.umd.js
View file @
964231cd
...
@@ -241,18 +241,20 @@ ${scripts}
...
@@ -241,18 +241,20 @@ ${scripts}
let
newData
=
{};
let
newData
=
{};
newData
.
options
=
data
.
options
;
newData
.
options
=
data
.
options
;
delete
newData
.
options
.
tpl
;
newData
.
views
=
data
.
views
;
newData
.
views
=
data
.
views
;
newData
.
assets
=
data
.
assets
;
newData
.
assets
=
data
.
assets
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
processes
=
data
.
processes
;
newData
.
processes
=
data
.
processes
;
delete
newData
.
options
.
tpl
;
deleteUnusedData
(
newData
.
processes
);
console
.
log
(
TAG
,
'start'
);
console
.
log
(
TAG
,
'start'
);
/*=====START process =====*/
/*=====START process =====*/
console
.
log
(
TAG
,
'start process'
);
console
.
log
(
TAG
,
'start process'
);
let
processIDs
=
[];
let
processIDs
=
[];
findDepPidsBat
(
processIDs
,
d
ata
.
processes
);
findDepPidsBat
(
processIDs
,
newD
ata
.
processes
);
let
builtinProcesses
=
newData
.
builtinProcesses
=
[];
let
builtinProcesses
=
newData
.
builtinProcesses
=
[];
let
bProcessIDs
=
processIDs
;
let
bProcessIDs
=
processIDs
;
...
@@ -270,7 +272,7 @@ ${scripts}
...
@@ -270,7 +272,7 @@ ${scripts}
}
}
}
}
for
(
let
process
of
d
ata
.
processes
)
{
for
(
let
process
of
newD
ata
.
processes
)
{
processManager
.
deal
(
process
);
processManager
.
deal
(
process
);
}
}
...
@@ -349,6 +351,25 @@ ${scripts}
...
@@ -349,6 +351,25 @@ ${scripts}
};
};
}
}
const
unusedFields
=
[
'design'
];
function
deleteUnusedData
(
processes
){
for
(
let
process
of
processes
){
if
(
process
.
sub
){
for
(
let
uuid
in
process
.
sub
){
let
subProcess
=
process
.
sub
[
uuid
];
for
(
let
field
of
unusedFields
){
if
(
subProcess
.
hasOwnProperty
(
field
)){
delete
subProcess
[
field
];
}
}
}
}
if
(
process
.
metas
&&
process
.
metas
.
length
>
0
){
deleteUnusedData
(
process
.
metas
);
}
}
}
function
findDepPids
(
list
,
process
)
{
function
findDepPids
(
list
,
process
)
{
if
(
process
.
sub
)
{
if
(
process
.
sub
)
{
for
(
let
key
in
process
.
sub
)
{
for
(
let
key
in
process
.
sub
)
{
...
@@ -375,7 +396,6 @@ ${scripts}
...
@@ -375,7 +396,6 @@ ${scripts}
list
.
push
(
process
);
list
.
push
(
process
);
findDepPids
(
newPids
,
process
);
findDepPids
(
newPids
,
process
);
}
}
//console.log('processes:', data.processes);
}
}
return
newPids
;
return
newPids
;
}
}
...
...
dist/index.umd.js.map
View file @
964231cd
This diff is collapsed.
Click to expand it.
src/index.js
View file @
964231cd
...
@@ -38,18 +38,20 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
...
@@ -38,18 +38,20 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
let
newData
=
{};
let
newData
=
{};
newData
.
options
=
data
.
options
;
newData
.
options
=
data
.
options
;
delete
newData
.
options
.
tpl
;
newData
.
views
=
data
.
views
;
newData
.
views
=
data
.
views
;
newData
.
assets
=
data
.
assets
;
newData
.
assets
=
data
.
assets
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
processes
=
data
.
processes
;
newData
.
processes
=
data
.
processes
;
delete
newData
.
options
.
tpl
;
deleteUnusedData
(
newData
.
processes
);
console
.
log
(
TAG
,
'start'
);
console
.
log
(
TAG
,
'start'
);
/*=====START process =====*/
/*=====START process =====*/
console
.
log
(
TAG
,
'start process'
);
console
.
log
(
TAG
,
'start process'
);
let
processIDs
=
[];
let
processIDs
=
[];
findDepPidsBat
(
processIDs
,
d
ata
.
processes
);
findDepPidsBat
(
processIDs
,
newD
ata
.
processes
);
let
builtinProcesses
=
newData
.
builtinProcesses
=
[];
let
builtinProcesses
=
newData
.
builtinProcesses
=
[];
let
bProcessIDs
=
processIDs
;
let
bProcessIDs
=
processIDs
;
...
@@ -67,7 +69,7 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
...
@@ -67,7 +69,7 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
}
}
}
}
for
(
let
process
of
d
ata
.
processes
)
{
for
(
let
process
of
newD
ata
.
processes
)
{
processManager
.
deal
(
process
);
processManager
.
deal
(
process
);
}
}
...
@@ -146,6 +148,25 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
...
@@ -146,6 +148,25 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
};
};
}
}
const
unusedFields
=
[
'design'
];
function
deleteUnusedData
(
processes
){
for
(
let
process
of
processes
){
if
(
process
.
sub
){
for
(
let
uuid
in
process
.
sub
){
let
subProcess
=
process
.
sub
[
uuid
];
for
(
let
field
of
unusedFields
){
if
(
subProcess
.
hasOwnProperty
(
field
)){
delete
subProcess
[
field
];
}
}
}
}
if
(
process
.
metas
&&
process
.
metas
.
length
>
0
){
deleteUnusedData
(
process
.
metas
);
}
}
}
function
findDepPids
(
list
,
process
)
{
function
findDepPids
(
list
,
process
)
{
if
(
process
.
sub
)
{
if
(
process
.
sub
)
{
for
(
let
key
in
process
.
sub
)
{
for
(
let
key
in
process
.
sub
)
{
...
@@ -172,7 +193,6 @@ async function addBuiltinProcesses(list, ids, getProcesses) {
...
@@ -172,7 +193,6 @@ async function addBuiltinProcesses(list, ids, getProcesses) {
list
.
push
(
process
);
list
.
push
(
process
);
findDepPids
(
newPids
,
process
);
findDepPids
(
newPids
,
process
);
}
}
//console.log('processes:', data.processes);
}
}
return
newPids
;
return
newPids
;
}
}
...
...
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