MCPcopy Create free account
hub / github.com/TruthHun/BookStack / buf2binstring

Function buf2binstring

static/word2md/mammoth.browser.js:18011–18024  ·  view source on GitHub ↗
(buf, len)

Source from the content-addressed store, hash-verified

18009
18010// Helper (used in 2 places)
18011function buf2binstring(buf, len) {
18012 // use fallback for big arrays to avoid stack overflow
18013 if (len < 65537) {
18014 if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
18015 return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
18016 }
18017 }
18018
18019 var result = '';
18020 for (var i = 0; i < len; i++) {
18021 result += String.fromCharCode(buf[i]);
18022 }
18023 return result;
18024}
18025
18026
18027// Convert byte array to binary string

Callers 1

mammoth.browser.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected