MCPcopy Create free account
hub / github.com/Stuk/jszip / str2array

Function str2array

test/asserts/file.js:361–367  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

359 if (JSZip.support.uint8array) {
360 QUnit.test("add file: file(name, Uint8Array)", function (assert) {
361 var str2array = function (str) {
362 var array = new Uint8Array(str.length);
363 for(var i = 0; i < str.length; i++) {
364 array[i] = str.charCodeAt(i);
365 }
366 return array;
367 };
368 var zip = new JSZip();
369 zip.file("file.txt", str2array("\xE2\x82\xAC15\n"));
370 testFileDataGetters(assert, {name : "utf8", zip : zip, textData : "€15\n", rawData : "\xE2\x82\xAC15\n"});

Callers 1

file.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected