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

Function decodeCodePointsArray

static/word2md/mammoth.browser.js:10687–10703  ·  view source on GitHub ↗
(codePoints)

Source from the content-addressed store, hash-verified

10685var MAX_ARGUMENTS_LENGTH = 0x1000
10686
10687function decodeCodePointsArray (codePoints) {
10688 var len = codePoints.length
10689 if (len <= MAX_ARGUMENTS_LENGTH) {
10690 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
10691 }
10692
10693 // Decode in chunks to avoid "call stack size exceeded".
10694 var res = ''
10695 var i = 0
10696 while (i < len) {
10697 res += String.fromCharCode.apply(
10698 String,
10699 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
10700 )
10701 }
10702 return res
10703}
10704
10705function asciiSlice (buf, start, end) {
10706 var ret = ''

Callers 1

utf8SliceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected