-
-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
221 changed files
with
86 additions
and
6,930 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
const fs = require('fs') | ||
let componentArr = [] | ||
const fs = require('fs'); | ||
let componentArr = []; | ||
|
||
function componentData () { | ||
let data = fs.readFileSync(`../config/component.json`, 'utf-8') | ||
let params = JSON.parse(data).components | ||
componentArr.push(...params) | ||
forParams(params) | ||
let result = [...new Set(componentArr)].join() | ||
return result | ||
}; | ||
function componentData() { | ||
let data = fs.readFileSync(`../config/component.json`, 'utf-8'); | ||
let params = JSON.parse(data).components; | ||
componentArr.push(...params); | ||
forParams(params); | ||
let result = [...new Set(componentArr)].join(); | ||
return result; | ||
} | ||
|
||
const forParams = (arr) => { | ||
let finishArr = [] | ||
let finishArr = []; | ||
arr.map(item => { | ||
let data = fs.readFileSync(`../src/${item}/index.json`, 'utf-8') | ||
const params = JSON.parse(data) | ||
const { usingComponents } = params | ||
let data = fs.readFileSync(`../src/${item}/index.json`, 'utf-8'); | ||
const params = JSON.parse(data); | ||
const { usingComponents } = params; | ||
if (usingComponents && !isEmptyObj(usingComponents)) { | ||
for (let key in usingComponents) { | ||
let keyComponent = key.substring(2, key.length) | ||
finishArr.push(keyComponent) | ||
let keyComponent = key.substring(2, key.length); | ||
finishArr.push(keyComponent); | ||
} | ||
componentArr.push(...finishArr) | ||
forParams(finishArr) | ||
componentArr.push(...finishArr); | ||
forParams(finishArr); | ||
} | ||
}) | ||
} | ||
}); | ||
}; | ||
|
||
const isEmptyObj = (obj) => { | ||
let result = (JSON.stringify(obj) === "{}"); | ||
return result | ||
} | ||
let result = (JSON.stringify(obj) === '{}'); | ||
return result; | ||
}; | ||
|
||
module.exports = componentData; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.