From 0d9b330235e2ed149d01881c87dd9c46fd80f3dd Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Mon, 18 Dec 2023 10:49:17 +0800 Subject: [PATCH] fix: normalize unicode without cache closes https://github.com/cnpm/cnpmcore/issues/624 --- lib/normalize-unicode.js | 11 +---------- package.json | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/normalize-unicode.js b/lib/normalize-unicode.js index 79e285ab..b7a72ae3 100644 --- a/lib/normalize-unicode.js +++ b/lib/normalize-unicode.js @@ -1,12 +1,3 @@ -// warning: extremely hot code path. -// This has been meticulously optimized for use -// within npm install on large package trees. -// Do not edit without careful benchmarking. -const normalizeCache = Object.create(null) -const { hasOwnProperty } = Object.prototype module.exports = s => { - if (!hasOwnProperty.call(normalizeCache, s)) { - normalizeCache[s] = s.normalize('NFD') - } - return normalizeCache[s] + return s.normalize('NFD') } diff --git a/package.json b/package.json index 46d91ee1..9282fcc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "author": "GitHub Inc.", - "name": "tar", + "name": "@fengmk2/tar", "description": "tar for node", "version": "6.2.0", "repository": {