Skip to content

Commit

Permalink
Update Rome
Browse files Browse the repository at this point in the history
  • Loading branch information
karniv00l committed Dec 6, 2022
1 parent 13eb0ed commit ff414b8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 39 deletions.
64 changes: 32 additions & 32 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
},
"devDependencies": {
"@types/js-yaml": "^4.0.5",
"@types/node": "^18.11.10",
"@types/node": "^18.11.11",
"@types/parsimmon": "^1.10.6",
"rome": "^10.0.1",
"rome": "^11.0.0",
"typescript": "^4.9.3"
},
"dependencies": {
Expand Down
3 changes: 3 additions & 0 deletions rome.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"recommended": true,
"style": {
"noImplicitBoolean": "off"
},
"suspicious": {
"noExplicitAny": "off"
}
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/ini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,9 @@ export class INI implements ParserInterface {

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

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

this.result.defines[result.name] = resolved;
}
Expand Down Expand Up @@ -1015,7 +1015,7 @@ export class INI implements ParserInterface {

private resolveBitsValues(name: string, values: string[]) {
return values
.map((val: string) => {
.flatMap((val: string) => {
const resolve = () => {
const defineName = INI.sanitize(val.slice(1)); // name without $
const resolved = this.result.defines[defineName];
Expand All @@ -1028,7 +1028,6 @@ export class INI implements ParserInterface {

return val.startsWith('$') ? resolve() : INI.sanitize(val);
})
.flat()
.filter((val) => val !== '');
}

Expand Down

0 comments on commit ff414b8

Please sign in to comment.