Skip to content

Commit

Permalink
perf: json5
Browse files Browse the repository at this point in the history
  • Loading branch information
adproqwq committed Mar 2, 2024
1 parent 6b1cd99 commit 22c66cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const convert = async () => {
const AppListFile = await fs.readFile(process.cwd() + '/AppList.json5', 'utf-8');
const lttSub = await fs.readFile(process.cwd() + '/ltt.json', 'utf-8');
const AppList = json5.parse(AppListFile);
const origin = JSON.parse(lttSub);
const origin = json5.parse(lttSub);
const originLength = getJsonArrayLength(origin);
let throwCount = 0;

Expand All @@ -76,7 +76,7 @@ const convert = async () => {
};
thisApp.id = AppList[index].appId;
thisApp.name = AppList[index].appName;
let Lrules = JSON.parse(a[hash[0]]).popup_rules;
let Lrules = json5.parse(a[hash[0]]).popup_rules;
let groupKeyCount = 1;
let ruleKeyCount = 0;

Expand All @@ -97,7 +97,7 @@ const convert = async () => {

if(r.hasOwnProperty('times')) thisRule['actionMaximum'] = r.times;

if(JSON.parse(a[hash[0]]).hasOwnProperty('delay')) thisRule['actionDelay'] = JSON.parse(a[hash[0]]).delay;
if(json5.parse(a[hash[0]]).hasOwnProperty('delay')) thisRule['actionDelay'] = json5.parse(a[hash[0]]).delay;

thisRule.matches.push(textRuleConvert(r.id));

Expand All @@ -113,8 +113,8 @@ const convert = async () => {
}

thisGroup.rules.push(thisRule);
if(JSON.parse(a[hash[0]]).hasOwnProperty('unite_popup_rules')){
if(JSON.parse(a[hash[0]]).unite_popup_rules == true) ruleKeyCount++;
if(json5.parse(a[hash[0]]).hasOwnProperty('unite_popup_rules')){
if(json5.parse(a[hash[0]]).unite_popup_rules == true) ruleKeyCount++;
}
else{
thisApp.groups.push(thisGroup);
Expand Down

0 comments on commit 22c66cb

Please sign in to comment.