From ff414b8d2d969ac13daae2a510ddae7ee010563e Mon Sep 17 00:00:00 2001 From: Piotr Rogowski Date: Tue, 6 Dec 2022 20:57:59 +0100 Subject: [PATCH] Update Rome --- package-lock.json | 64 +++++++++++++++++++++++------------------------ package.json | 4 +-- rome.json | 3 +++ src/ini.ts | 9 +++---- 4 files changed, 41 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 21a32be..5b0878a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,9 +18,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" } }, @@ -31,9 +31,9 @@ "license": "MIT" }, "node_modules/@rometools/cli-darwin-arm64": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-10.0.1.tgz", - "integrity": "sha512-MwQjk3uhZrCu6LgIwJHREAsVt/mUQTGv7p8iosfaF8lCIxMVjyS+akbF/QcBufyW5sFtHYNWUEe/uKPHK4E//A==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-11.0.0.tgz", + "integrity": "sha512-F3vkdY+s3FLIEnAjSbyHTuIPB88cLpccimW4ecid5I7S6GzGG3iUJI4xT00JhH73K4P/qW20/9r+kH1T9Du8Xg==", "cpu": [ "arm64" ], @@ -44,9 +44,9 @@ ] }, "node_modules/@rometools/cli-darwin-x64": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-x64/-/cli-darwin-x64-10.0.1.tgz", - "integrity": "sha512-n010Wc/z9L8wRkRnR5boMhdWgDVGrTG/i7zL8u/3+F5aSUgLCywf9F/b3ex74tCJJfcwBLlhaAqAVQX6U1bIkA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-x64/-/cli-darwin-x64-11.0.0.tgz", + "integrity": "sha512-X6jhtS6Iml4GOzgNtnLwIp/KXXhSdqeVyfv69m/AHnIzx3gQAjPZ7BPnJLvTCbhe4SKHL+uTZYFSCJpkUUKE6w==", "cpu": [ "x64" ], @@ -57,9 +57,9 @@ ] }, "node_modules/@rometools/cli-linux-arm64": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@rometools/cli-linux-arm64/-/cli-linux-arm64-10.0.1.tgz", - "integrity": "sha512-JljZsnud1KCfe36VNsVh/LrYdAzgbKbcsCTzeCjW9ROkMyNj8pmQ/gIUFxZ+PyhMFgowHIDGihoNf4m+pgpxkA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@rometools/cli-linux-arm64/-/cli-linux-arm64-11.0.0.tgz", + "integrity": "sha512-dktTJJlTpmycBZ2TwhJBcAO8ztK8DdevdyZnFFxdYRvtmJgTjIsC2UFayf/SbKew8B8q1IhI0it+D6ihAeIpeg==", "cpu": [ "arm64" ], @@ -70,9 +70,9 @@ ] }, "node_modules/@rometools/cli-linux-x64": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@rometools/cli-linux-x64/-/cli-linux-x64-10.0.1.tgz", - "integrity": "sha512-jXIqd9iDyZUexk63CRfAXDA4zNDUHpErUmCejjGab3dhDt1KA40fDqKb+kxZpAhY3tQoWNSNQyo750zX5NawLw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@rometools/cli-linux-x64/-/cli-linux-x64-11.0.0.tgz", + "integrity": "sha512-WVcnXPNdWGUWo0p4NU8YzuthjYR7q+b4vRcjdxtP1DlpphZmSsoC/RSE85nEqRAz8hChcKUansVzOPM8BSsuGA==", "cpu": [ "x64" ], @@ -83,9 +83,9 @@ ] }, "node_modules/@rometools/cli-win32-arm64": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@rometools/cli-win32-arm64/-/cli-win32-arm64-10.0.1.tgz", - "integrity": "sha512-G/toRrKPhhi7SMYMyROq/E2c8/4xRX/67vFhVihuMvDDzhanIb99hEt5MMbM4HbYK1nnZBPyLN6LxVsxm9M9hA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@rometools/cli-win32-arm64/-/cli-win32-arm64-11.0.0.tgz", + "integrity": "sha512-tPj6RThQzS7Q45jqQll7NlTYvNcsg/BEP3LYiiazqSh9FAFnMkrV6ewUcMPKWyAfiyLs7jlz4rRvdNRUSygzfQ==", "cpu": [ "arm64" ], @@ -96,9 +96,9 @@ ] }, "node_modules/@rometools/cli-win32-x64": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@rometools/cli-win32-x64/-/cli-win32-x64-10.0.1.tgz", - "integrity": "sha512-y299+VGoBufZntZj0Xz7w9DODU+6E5giXStfBDoa0fspXGNkYyYfD+HC6j9gUv4zpMZJ607XVvVHjpfwM/3ftA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@rometools/cli-win32-x64/-/cli-win32-x64-11.0.0.tgz", + "integrity": "sha512-bmBai8WHxYjsGk1+je7ZTfCUCWq30WJI3pQM8pzTA674lfGTZ9ymJoZwTaIMSO4rL5V9mlO6uLunsBKso9VqOg==", "cpu": [ "x64" ], @@ -115,9 +115,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.11.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.10.tgz", - "integrity": "sha512-juG3RWMBOqcOuXC643OAdSA525V44cVgGV6dUDuiFtss+8Fk5x1hI93Rsld43VeJVIeqlP9I7Fn9/qaVqoEAuQ==", + "version": "18.11.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.11.tgz", + "integrity": "sha512-KJ021B1nlQUBLopzZmPBVuGU9un7WJd/W4ya7Ih02B4Uwky5Nja0yGYav2EfYIk0RR2Q9oVhf60S2XR1BCWJ2g==", "dev": true }, "node_modules/@types/parsimmon": { @@ -148,9 +148,9 @@ "integrity": "sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw==" }, "node_modules/rome": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/rome/-/rome-10.0.1.tgz", - "integrity": "sha512-RfaDa+cSustBsjX6bj3fWqEhoNxXrK1uNgKHpkCHAqp20QMJXnCRtbokhirNMe0utyGI9GTO/sDoK7hJP7O8Bw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/rome/-/rome-11.0.0.tgz", + "integrity": "sha512-rRo6JOwpMLc3OkeTDRXkrmrDqnxDvZ75GS4f0jLDBNmRgDXWbu0F8eVnJoRn+VbK2AE7vWvhVOMBjnWowcopkQ==", "dev": true, "hasInstallScript": true, "bin": { @@ -160,12 +160,12 @@ "node": ">=14.*" }, "optionalDependencies": { - "@rometools/cli-darwin-arm64": "10.0.1", - "@rometools/cli-darwin-x64": "10.0.1", - "@rometools/cli-linux-arm64": "10.0.1", - "@rometools/cli-linux-x64": "10.0.1", - "@rometools/cli-win32-arm64": "10.0.1", - "@rometools/cli-win32-x64": "10.0.1" + "@rometools/cli-darwin-arm64": "11.0.0", + "@rometools/cli-darwin-x64": "11.0.0", + "@rometools/cli-linux-arm64": "11.0.0", + "@rometools/cli-linux-x64": "11.0.0", + "@rometools/cli-win32-arm64": "11.0.0", + "@rometools/cli-win32-x64": "11.0.0" } }, "node_modules/typescript": { diff --git a/package.json b/package.json index 0fde38d..1f82922 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/rome.json b/rome.json index bb92ee9..e2440dd 100644 --- a/rome.json +++ b/rome.json @@ -21,6 +21,9 @@ "recommended": true, "style": { "noImplicitBoolean": "off" + }, + "suspicious": { + "noExplicitAny": "off" } } } diff --git a/src/ini.ts b/src/ini.ts index 14dc53b..e531321 100644 --- a/src/ini.ts +++ b/src/ini.ts @@ -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; } @@ -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]; @@ -1028,7 +1028,6 @@ export class INI implements ParserInterface { return val.startsWith('$') ? resolve() : INI.sanitize(val); }) - .flat() .filter((val) => val !== ''); }