Skip to content

Commit

Permalink
jsDelivr Purge
Browse files Browse the repository at this point in the history
  • Loading branch information
taichunmin committed May 31, 2024
1 parent 9512715 commit 4393542
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ jobs:
uses: actions/deploy-pages@v4
- name: 發布至 npm
uses: JS-DevTools/npm-publish@v3
id: npm-publish
with:
access: public
token: ${{ secrets.NPM_TOKEN }}
token: ${{ secrets.NPM_TOKEN }}
- name: jsDelivr Purge
if: ${{ steps.npm-publish.outputs.type }}
uses: egad13/purge-jsdelivr-cache@v1
with:
url: |
https://cdn.jsdelivr.net/npm/@taichunmin/buffer@0/dist/buffer.global.js
https://cdn.jsdelivr.net/npm/@taichunmin/buffer/dist/buffer.global.js
https://cdn.jsdelivr.net/npm/@taichunmin/buffer@0/dist/buffer.global.min.js
https://cdn.jsdelivr.net/npm/@taichunmin/buffer/dist/buffer.global.min.js
https://cdn.jsdelivr.net/npm/@taichunmin/buffer@0/dist/buffer.mjs/+esm
https://cdn.jsdelivr.net/npm/@taichunmin/buffer/dist/buffer.mjs/+esm
4 changes: 1 addition & 3 deletions lib/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2207,9 +2207,7 @@ export class Buffer extends Uint8Array {
static toBase64urlString (buf: Buffer): string {
const arr = []
for (let i = 0; i < buf.length; i += 3) {
const u24 = (buf[i] << 16) +
((i + 1 < buf.length ? buf[i + 1] : 0) << 8) +
(i + 2 < buf.length ? buf[i + 2] : 0)
const u24 = (buf[i] << 16) + ((buf[i + 1] ?? 0) << 8) + (buf[i + 2] ?? 0)
arr.push(...[
CHARCODE_BASE64URL.get(u24 >>> 18 & 0x3F),
CHARCODE_BASE64URL.get(u24 >>> 12 & 0x3F),
Expand Down

0 comments on commit 4393542

Please sign in to comment.