From 4a7e9b47ed24d7e2d71dfbc540462e5aa4c299ac Mon Sep 17 00:00:00 2001 From: Cashew Date: Fri, 29 Dec 2023 11:11:50 +0700 Subject: [PATCH 1/2] remove redundancy --- ext/js/general/cache-map.js | 1 - test/cache-map.test.js | 2 -- 2 files changed, 3 deletions(-) diff --git a/ext/js/general/cache-map.js b/ext/js/general/cache-map.js index a995b8c7b6..8650d8e694 100644 --- a/ext/js/general/cache-map.js +++ b/ext/js/general/cache-map.js @@ -29,7 +29,6 @@ export class CacheMap { */ constructor(maxSize) { if (!( - typeof maxSize === 'number' && Number.isFinite(maxSize) && maxSize >= 0 && Math.floor(maxSize) === maxSize diff --git a/test/cache-map.test.js b/test/cache-map.test.js index 52ada57ca8..5c9fb81569 100644 --- a/test/cache-map.test.js +++ b/test/cache-map.test.js @@ -32,8 +32,6 @@ function testConstructor() { [true, () => new CacheMap(1.5)], [true, () => new CacheMap(Number.NaN)], [true, () => new CacheMap(Number.POSITIVE_INFINITY)], - // @ts-expect-error - Ignore because it should throw an error - [true, () => new CacheMap('a')] ]; for (const [throws, create] of data) { From 8dc39bf0d83066dcbb3ef0ea01cfb488b856eadd Mon Sep 17 00:00:00 2001 From: Cashew Date: Fri, 29 Dec 2023 11:20:46 +0700 Subject: [PATCH 2/2] fix lint --- test/cache-map.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cache-map.test.js b/test/cache-map.test.js index 5c9fb81569..9db306772b 100644 --- a/test/cache-map.test.js +++ b/test/cache-map.test.js @@ -31,7 +31,7 @@ function testConstructor() { [true, () => new CacheMap(-1)], [true, () => new CacheMap(1.5)], [true, () => new CacheMap(Number.NaN)], - [true, () => new CacheMap(Number.POSITIVE_INFINITY)], + [true, () => new CacheMap(Number.POSITIVE_INFINITY)] ]; for (const [throws, create] of data) {