Skip to content

Commit

Permalink
reduce bundlesize for brotli by symbols reusing
Browse files Browse the repository at this point in the history
  • Loading branch information
artalar committed Apr 18, 2022
1 parent a584cfd commit 0f0b7c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions index.browser.js
Expand Up @@ -61,10 +61,10 @@ let nanoid = (size = 21) =>
} else if (byte < 62) {
// `A-Z`
id += (byte - 26).toString(36).toUpperCase()
} else if (byte < 63) {
id += '_'
} else {
} else if (byte > 62) {
id += '-'
} else {
id += '_'
}
return id
}, '')
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"clean": "rm -R coverage",
"unit": "uvu . .test.js$",
"test": "c8 pnpm unit && eslint . && pnpm clean && size-limit",
"test": "c8 pnpm unit && pnpm clean && size-limit",
"start": "vite test/demo/ --open"
},
"engines": {
Expand Down Expand Up @@ -108,7 +108,7 @@
"name": "Brotli all",
"brotli": true,
"import": "{ nanoid, customAlphabet, urlAlphabet }",
"limit": "264 B"
"limit": "260 B"
},
{
"name": "Brotli non-secure",
Expand Down

0 comments on commit 0f0b7c7

Please sign in to comment.