MCPcopy
hub / github.com/gildas-lormeau/zip.js / encodeText

Function encodeText

index.cjs:344–356  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

342
343
344function encodeText(value) {
345 // deno-lint-ignore valid-typeof
346 if (typeof TextEncoder == UNDEFINED_TYPE) {
347 value = unescape(encodeURIComponent(value));
348 const result = new Uint8Array(value.length);
349 for (let i = 0; i < result.length; i++) {
350 result[i] = value.charCodeAt(i);
351 }
352 return result;
353 } else {
354 return new TextEncoder().encode(value);
355 }
356}
357
358// Derived from https://github.com/xqdoo00o/jszip/blob/master/lib/sjcl.js and https://github.com/bitwiseshiftleft/sjcl
359

Callers 2

encodePasswordFunction · 0.70
addFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…