From 800fd7269235c574ee7c397bf03a2175f5f16af9 Mon Sep 17 00:00:00 2001 From: Myrotvorets Date: Sat, 24 Aug 2024 03:05:54 +0300 Subject: [PATCH] Update code --- lib/ipList/index.ts | 2 +- test/unit/ipList.test.ts | 2 ++ test/unit/iso31661Alpha2.test.ts | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ipList/index.ts b/lib/ipList/index.ts index 1bdc0b4..3018c89 100644 --- a/lib/ipList/index.ts +++ b/lib/ipList/index.ts @@ -31,7 +31,7 @@ export const ipListEx = makeValidator((input: string) => { try { return items.map((s) => ipaddr.process(s.trim())); - } catch (e) { + } catch { throw new EnvError(`Invalid IP list input: "${input}"`); } }); diff --git a/test/unit/ipList.test.ts b/test/unit/ipList.test.ts index 67b76f6..37f9404 100644 --- a/test/unit/ipList.test.ts +++ b/test/unit/ipList.test.ts @@ -1,3 +1,5 @@ +/* eslint-disable sonarjs/no-nested-functions */ +/* eslint-disable sonarjs/no-hardcoded-ip */ import { EnvError } from 'envalid'; import ipaddr from 'ipaddr.js'; import { ipList, ipListEx } from '../../lib'; diff --git a/test/unit/iso31661Alpha2.test.ts b/test/unit/iso31661Alpha2.test.ts index a323d8b..e2cf8ff 100644 --- a/test/unit/iso31661Alpha2.test.ts +++ b/test/unit/iso31661Alpha2.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable sonarjs/no-nested-functions */ import { EnvError } from 'envalid'; import { iso31661Alpha2, iso31661Alpha2List } from '../../lib';