Skip to content

Commit

Permalink
fix: normalize unicode without cache
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 18, 2023
1 parent 5bc9d40 commit 0d9b330
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions lib/normalize-unicode.js
Original file line number Diff line number Diff line change
@@ -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')
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"author": "GitHub Inc.",
"name": "tar",
"name": "@fengmk2/tar",
"description": "tar for node",
"version": "6.2.0",
"repository": {
Expand Down

0 comments on commit 0d9b330

Please sign in to comment.