Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency magic-string to v0.30.17 - autoclosed #1879

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.


Unchanged files with check annotations Beta

function compress(text) {
const { encodedData, encodingTable } = huffman.encode(text);
const cipherBuffer = huffman.compress(encodedData);
const cipherText = base64.encode(cipherBuffer);

Check warning on line 18 in spikes/url-shortening/techniques/huffman.js

GitHub Actions / Lints

Caution: `base64` also has a named export `encode`. Check if you meant to write `import {encode} from '@algorithm.ts/base64'` instead
const textEncoder = new TextEncoder('utf-8');
const encodingTableText = base64.encode(

Check warning on line 21 in spikes/url-shortening/techniques/huffman.js

GitHub Actions / Lints

Caution: `base64` also has a named export `encode`. Check if you meant to write `import {encode} from '@algorithm.ts/base64'` instead
textEncoder.encode(JSON.stringify(compressEncodingTable(encodingTable)))
);
const result = (encodingTableText + '-' + cipherText)
.split('-');
const textDecoder = new TextDecoder('utf-8');
const encodingTable = decompressEncodingTable(
JSON.parse(textDecoder.decode(base64.decode(encodingTableText)))

Check warning on line 54 in spikes/url-shortening/techniques/huffman.js

GitHub Actions / Lints

Caution: `base64` also has a named export `decode`. Check if you meant to write `import {decode} from '@algorithm.ts/base64'` instead
);
const tree = huffman.fromEncodingTable(encodingTable);
const cipherData = huffman.decompress(base64.decode(cipherText));

Check warning on line 58 in spikes/url-shortening/techniques/huffman.js

GitHub Actions / Lints

Caution: `base64` also has a named export `decode`. Check if you meant to write `import {decode} from '@algorithm.ts/base64'` instead
const plaintext = huffman.decode(cipherData, tree);
return plaintext;