MCPcopy Create free account
hub / github.com/SocketCluster/socketcluster / decodeCodePointsArray

Function decodeCodePointsArray

app/public/socketcluster-client.js:3630–3646  ·  view source on GitHub ↗
(codePoints)

Source from the content-addressed store, hash-verified

3628var MAX_ARGUMENTS_LENGTH = 0x1000
3629
3630function decodeCodePointsArray (codePoints) {
3631 var len = codePoints.length
3632 if (len <= MAX_ARGUMENTS_LENGTH) {
3633 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
3634 }
3635
3636 // Decode in chunks to avoid "call stack size exceeded".
3637 var res = ''
3638 var i = 0
3639 while (i < len) {
3640 res += String.fromCharCode.apply(
3641 String,
3642 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
3643 )
3644 }
3645 return res
3646}
3647
3648function asciiSlice (buf, start, end) {
3649 var ret = ''

Callers 1

utf8SliceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…