MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / blobAsText

Function blobAsText

test/injected/gm-resource.test.js:6–6  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4const stringAsBase64 = str => btoa(buffer2string(new TextEncoder().encode(str).buffer));
5
6const blobAsText = async blob => new TextDecoder().decode(await readBlob(blob, true));
7
8// WARNING: don't include D800-DFFF range which is for surrogate pairs
9const RESOURCE_TEXT = 'abcd\u1234\u2345\u3456\u4567\u5678\u6789\u789A\u89AB\u9ABC\uABCD';

Callers 1

Calls 1

readBlobFunction · 0.90

Tested by

no test coverage detected