From 3ba44ce311e41d384665ff382ccb969abbb6fa14 Mon Sep 17 00:00:00 2001 From: KaKa Date: Tue, 1 Nov 2022 15:04:26 +0800 Subject: [PATCH] fix: tiny-lru usage (#4391) chore: bump tiny-lru to 10.0.0 refactor: more explicit check --- lib/contentTypeParser.js | 5 ++--- package.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/contentTypeParser.js b/lib/contentTypeParser.js index 8f46dd0b61..3326e192c3 100644 --- a/lib/contentTypeParser.js +++ b/lib/contentTypeParser.js @@ -94,9 +94,8 @@ ContentTypeParser.prototype.getParser = function (contentType) { return this.customParsers.get(contentType) } - if (this.cache.has(contentType)) { - return this.cache.get(contentType) - } + const parser = this.cache.get(contentType) + if (parser !== undefined) return parser // eslint-disable-next-line no-var for (var i = 0; i !== this.parserList.length; ++i) { diff --git a/package.json b/package.json index 6dd992d589..ed5c910b3f 100644 --- a/package.json +++ b/package.json @@ -184,7 +184,7 @@ "rfdc": "^1.3.0", "secure-json-parse": "^2.5.0", "semver": "^7.3.7", - "tiny-lru": "^9.0.2" + "tiny-lru": "^10.0.0" }, "standard": { "ignore": [