diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8b3e015..9d071c3 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22-alpine +FROM node:24-alpine ARG USERNAME=node ARG USER_UID=1000 diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index f604c92..6c7f9e9 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -17,10 +17,10 @@ jobs: with: fetch-depth: 0 - - name: Use Node.js 22.x + - name: Use Node.js 24.x uses: actions/setup-node@v5 with: - node-version: 22.x + node-version: 24.x - run: npm install - run: npm run lint - run: npm test @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16.x, 18.x, 20.x, 22.x] + node-version: [16.x, 18.x, 20.x, 22.x, 24.x] os: [ ubuntu-latest, windows-latest ] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 9aeea09..ccda912 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions/setup-node@v5 with: - node-version: 22 + node-version: 24 - run: npm install - run: npm test env: @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions/setup-node@v5 with: - node-version: 22 + node-version: 24 registry-url: https://registry.npmjs.org/ - run: npm install - run: npm publish --provenance --access public diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 879d9d1..6c2d6b7 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -33,10 +33,10 @@ jobs: ref: ${{ steps.pr.outputs.head_sha }} fetch-depth: 0 - - name: Use Node.js 22.x + - name: Use Node.js 24.x uses: actions/setup-node@v5 with: - node-version: 22.x + node-version: 24.x - run: npm install - run: npm run lint - run: npm test diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 6163df3..d4ff1e4 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -7,7 +7,7 @@ on: node: description: 'Node version' required: true - default: '22.x' + default: '24.x' os: description: 'Operating System (ubuntu-20.04, ubuntu-latest, windows-latest)' required: true diff --git a/package.json b/package.json index a1e6c71..191a123 100644 --- a/package.json +++ b/package.json @@ -32,13 +32,13 @@ ], "devDependencies": { "@babel/eslint-parser": "^7.28.4", - "@typescript-eslint/eslint-plugin": "^8.44.1", - "@typescript-eslint/parser": "^8.44.1", + "@typescript-eslint/eslint-plugin": "^8.45.0", + "@typescript-eslint/parser": "^8.45.0", "c8": "^10.1.3", "chai": "^6.2.0", "env-cmd": "^11.0.0", - "eslint": "^9.36.0", - "mocha": "^11.7.2", + "eslint": "^9.37.0", + "mocha": "^11.7.4", "mocha-sonarqube-reporter": "^1.0.2", "sinon": "^21.0.0" }, diff --git a/src/client.js b/src/client.js index 37aead1..f82f0b1 100644 --- a/src/client.js +++ b/src/client.js @@ -71,11 +71,11 @@ export class Client { } }; - Object.entries(optionsHandler).forEach(([key, handler]) => { + for (const [key, handler] of Object.entries(optionsHandler)) { if (key in options) { handler(options[key]); } - }); + } this.#initTimedMatch(options); } diff --git a/src/lib/remoteAuth.js b/src/lib/remoteAuth.js index 5f636f8..f1c8176 100644 --- a/src/lib/remoteAuth.js +++ b/src/lib/remoteAuth.js @@ -17,7 +17,7 @@ export class Auth { static setRetryOptions(silentMode) { this.#retryOptions = { - retryTime: parseInt(silentMode.slice(0, -1)), + retryTime: Number.parseInt(silentMode.slice(0, -1)), retryDurationIn: silentMode.slice(-1), }; } diff --git a/src/lib/snapshot.js b/src/lib/snapshot.js index 8a1537a..652cebc 100644 --- a/src/lib/snapshot.js +++ b/src/lib/snapshot.js @@ -48,7 +48,7 @@ const checkSwitchersLocal = (snapshot, switcherKeys) => { found = false; const { config } = g; - if (config.find(c => c.key === switcher)) { + if (config.some(c => c.key === switcher)) { found = true; break; } @@ -229,7 +229,7 @@ function processPAYLOAD(operation, input, values) { const keys = payloadReader(inputJson); switch(operation) { case OperationsType.HAS_ONE: - return keys.filter(key => values.includes(key)).length > 0; + return keys.some(key => values.includes(key)); case OperationsType.HAS_ALL: return values.every(element => keys.includes(element)); } diff --git a/src/lib/utils/ipcidr.js b/src/lib/utils/ipcidr.js index 7f4b314..cb6918a 100644 --- a/src/lib/utils/ipcidr.js +++ b/src/lib/utils/ipcidr.js @@ -4,7 +4,7 @@ export default class IPCIDR { } ip4ToInt(ip) { - return ip.split('.').reduce((int, oct) => (int << 8) + parseInt(oct, 10), 0) >>> 0; + return ip.split('.').reduce((int, oct) => (int << 8) + Number.parseInt(oct, 10), 0) >>> 0; } isIp4InCidr(ip) { diff --git a/src/lib/utils/payloadReader.js b/src/lib/utils/payloadReader.js index c96a720..cbc2d02 100644 --- a/src/lib/utils/payloadReader.js +++ b/src/lib/utils/payloadReader.js @@ -7,7 +7,7 @@ export function payloadReader(payload) { return Object.keys(payloadRead) .flatMap(field => [field, ...payloadReader(payload[field]) .map(nestedField => `${field}.${nestedField}`)]) - .filter(field => isNaN(Number(field))) + .filter(field => Number.isNaN(Number(field))) .reduce((acc, curr) => { if (!acc.includes(curr)) { acc.push(curr);