Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22-alpine
FROM node:24-alpine

ARG USERNAME=node
ARG USER_UID=1000
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
4 changes: 2 additions & 2 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/remoteAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/ipcidr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/payloadReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down