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';