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 denoland/deno:2.4.5
FROM denoland/deno:2.4.3

# Install tools
RUN apt-get update && \
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: Setup Deno v2.5.2
- name: Setup Deno v2.5.3
uses: denoland/setup-deno@v2
with:
deno-version: v2.5.2
deno-version: v2.5.3

- name: Setup LCOV
run: sudo apt install -y lcov
Expand All @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
deno-version: [v1.46.3, v2.5.2]
deno-version: [v1.46.3, v2.5.3]
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}

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: Setup Deno v2.5.2
- name: Setup Deno v2.5.3
uses: denoland/setup-deno@v2
with:
deno-version: v2.5.2
deno-version: v2.5.3

- name: Setup LCOV
run: sudo apt install -y lcov
Expand Down
2 changes: 1 addition & 1 deletion src/lib/remoteAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class Auth {

static setRetryOptions(silentMode: string) {
this.retryOptions = {
retryTime: parseInt(silentMode.slice(0, -1)),
retryTime: Number.parseInt(silentMode.slice(0, -1)),
retryDurationIn: silentMode.slice(-1),
};
}
Expand Down
8 changes: 4 additions & 4 deletions src/lib/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const checkSwitchersLocal = (snapshot: Snapshot, switcherKeys: string[])
found = false;
const { config } = g;

if (config.find((c: { key: string }) => c.key === switcher)) {
if (config.some((c: { key: string }) => c.key === switcher)) {
found = true;
break;
}
Expand Down Expand Up @@ -177,7 +177,7 @@ function processNETWORK_Exist(
cidrRegex: RegExp,
) {
for (const value of values) {
if (RegExp(cidrRegex).exec(value)) {
if (cidrRegex.exec(value)) {
const cidr = new IPCIDR(value);
if (cidr.isIp4InCidr(input)) {
return true;
Expand All @@ -195,7 +195,7 @@ function processNETWORK_NotExist(
cidrRegex: RegExp,
) {
const result = values.filter((element) => {
if (RegExp(cidrRegex).exec(element)) {
if (cidrRegex.exec(element)) {
const cidr = new IPCIDR(element);
if (cidr.isIp4InCidr(input)) {
return true;
Expand Down Expand Up @@ -301,7 +301,7 @@ function processPAYLOAD(operation: string, input: string, values: string[]) {
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.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class IPCIDR {
}

private ip4ToInt(ip: string) {
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: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/payloadReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function payloadReader(payload: any): string[] {
...payloadReader(payload[field])
.map((nestedField) => `${field}.${nestedField}`),
])
.filter((field) => isNaN(Number(field)))
.filter((field) => Number.isNaN(Number(field)))
.reduce((acc: string[], curr) => {
if (!acc.includes(curr)) {
acc.push(curr);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/timed-match/match.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function tryMatch(values: string[], input: string): boolean {
let result = false;
for (const value of values) {
if (RegExp(value).exec(input)) {
if (new RegExp(value).exec(input)) {
result = true;
break;
}
Expand Down