Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
karniv00l committed Sep 11, 2023
1 parent cc4e710 commit 0a13120
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 71 deletions.
79 changes: 39 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@
"start": "tsc --watch",
"generate": "npm run build && node test/test.js generate",
"test": "npm run build && node test/test.js",
"lint": "tsc && rome ci src",
"lint": "tsc && npm run lint:rome",
"lint:rome": "rome ci src",
"lint:fix": "rome format --write src && rome check --apply src",
"lint:fix:suggested": "rome check --apply-suggested src"
"lint:fix:unsafe": "rome check --apply-unsafe src"
},
"devDependencies": {
"@types/js-yaml": "^4.0.5",
"@types/node": "^18.14.4",
"@types/node": "^20.6.0",
"@types/parsimmon": "^1.10.6",
"rome": "^11.0.0",
"typescript": "^4.9.5"
"rome": "^12.1.3",
"typescript": "^5.2.2"
},
"dependencies": {
"@hyper-tuner/types": "^0.4.2",
"@hyper-tuner/types": "git+https://github.com/hyper-tuner/types.git",
"js-yaml": "^4.1.0",
"parsimmon": "^1.18.1"
}
Expand Down
17 changes: 15 additions & 2 deletions rome.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,25 @@
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"all": true,
"correctness": {
"all": true,
"noUnusedVariables": "warn"
},
"style": {
"noImplicitBoolean": "off"
"all": true,
"noImplicitBoolean": "off",
"useEnumInitializers": "off",
"noNonNullAssertion": "off"
},
"suspicious": {
"all": true,
"noExplicitAny": "off"
},
"nursery": {
"all": true,
"useExhaustiveDependencies": "off",
"noForEach": "off"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ switch (command) {
break;
}

default:
default: {
console.info(
`❗️ Unknown command: ${command}, please use one of: [${Object.values(Commands).join(', ')}]`,
);
process.exit(1);
break;
}
}
46 changes: 24 additions & 22 deletions src/ini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,9 @@ export class INI implements ParserInterface {
if (!this.currentCurve) {
throw new Error('Curve not set');
}
this.result.curves[this.currentCurve].xAxis = xAxisResult.value.values.map((val: string) =>
INI.isNumber(val) ? Number(val) : INI.sanitize(val),
);
this.result.curves[this.currentCurve].xAxis = xAxisResult.value.values.map((val: string) => {
return INI.isNumber(val) ? Number(val) : INI.sanitize(val);
});

return;
}
Expand All @@ -495,9 +495,9 @@ export class INI implements ParserInterface {
if (!this.currentCurve) {
throw new Error('Curve not set');
}
this.result.curves[this.currentCurve].yAxis = yAxisResult.value.values.map((val: string) =>
INI.isNumber(val) ? Number(val) : INI.sanitize(val),
);
this.result.curves[this.currentCurve].yAxis = yAxisResult.value.values.map((val: string) => {
return INI.isNumber(val) ? Number(val) : INI.sanitize(val);
});

return;
}
Expand All @@ -507,9 +507,9 @@ export class INI implements ParserInterface {
if (!this.currentCurve) {
throw new Error('Curve not set');
}
this.result.curves[this.currentCurve].xBins = xBinsResult.value.values.map((val: string) =>
INI.isNumber(val) ? Number(val) : INI.sanitize(val),
);
this.result.curves[this.currentCurve].xBins = xBinsResult.value.values.map((val: string) => {
return INI.isNumber(val) ? Number(val) : INI.sanitize(val);
});

return;
}
Expand All @@ -519,9 +519,9 @@ export class INI implements ParserInterface {
if (!this.currentCurve) {
throw new Error('Curve not set');
}
this.result.curves[this.currentCurve].yBins = yBinsResult.value.values.map((val: string) =>
INI.isNumber(val) ? Number(val) : INI.sanitize(val),
);
this.result.curves[this.currentCurve].yBins = yBinsResult.value.values.map((val: string) => {
return INI.isNumber(val) ? Number(val) : INI.sanitize(val);
});

return;
}
Expand All @@ -531,9 +531,9 @@ export class INI implements ParserInterface {
if (!this.currentCurve) {
throw new Error('Curve not set');
}
this.result.curves[this.currentCurve].size = size.value.values.map((val: string) =>
INI.isNumber(val) ? Number(val) : INI.sanitize(val),
);
this.result.curves[this.currentCurve].size = size.value.values.map((val: string) => {
return INI.isNumber(val) ? Number(val) : INI.sanitize(val);
});
}
}

Expand Down Expand Up @@ -870,9 +870,9 @@ export class INI implements ParserInterface {

this.result.defines[result.name] = result.values.map(INI.sanitize);

const resolved = this.result.defines[result.name].flatMap((val) =>
val.startsWith('$') ? this.result.defines[val.slice(1)] : val,
);
const resolved = this.result.defines[result.name].flatMap((val) => {
return val.startsWith('$') ? this.result.defines[val.slice(1)] : val;
});

this.result.defines[result.name] = resolved;
}
Expand Down Expand Up @@ -1154,11 +1154,13 @@ export class INI implements ParserInterface {
.tryParse(line);
}

private static numberOrExpression = (val: string | undefined | null) =>
INI.isNumber(val || '0') ? Number(val || 0) : INI.sanitize(`${val}`);
private static numberOrExpression = (val: string | undefined | null) => {
return INI.isNumber(val || '0') ? Number(val || 0) : INI.sanitize(`${val}`);
};

private static sanitize = (val: any) =>
val === undefined ? '' : `${val}`.replace(/"/g, '').replace(/\s+/g, ' ').trim();
private static sanitize = (val: any) => {
return val === undefined ? '' : `${val}`.replace(/"/g, '').replace(/\s+/g, ' ').trim();
};

private static isNumber = (val: any) => !Number.isNaN(Number(val));

Expand Down

0 comments on commit 0a13120

Please sign in to comment.