From 59961b6eeb46a93aa2db587a047e6da79b2dceda Mon Sep 17 00:00:00 2001 From: Cashew <52880648+Scrub1492@users.noreply.github.com> Date: Fri, 29 Dec 2023 12:05:11 +0700 Subject: [PATCH] remove redundancy in cache-map (#485) * remove redundancy * fix lint --- ext/js/general/cache-map.js | 1 - test/cache-map.test.js | 4 +--- 2 files changed, 1 insertion(+), 4 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..9db306772b 100644 --- a/test/cache-map.test.js +++ b/test/cache-map.test.js @@ -31,9 +31,7 @@ function testConstructor() { [true, () => new CacheMap(-1)], [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')] + [true, () => new CacheMap(Number.POSITIVE_INFINITY)] ]; for (const [throws, create] of data) {