MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / decodeCodePointsArray

Function decodeCodePointsArray

lib/models/dav.js:2853–2869  ·  view source on GitHub ↗
(codePoints)

Source from the content-addressed store, hash-verified

2851var MAX_ARGUMENTS_LENGTH = 0x1000;
2852
2853function decodeCodePointsArray (codePoints) {
2854 var len = codePoints.length;
2855 if (len <= MAX_ARGUMENTS_LENGTH) {
2856 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
2857 }
2858
2859 // Decode in chunks to avoid "call stack size exceeded".
2860 var res = '';
2861 var i = 0;
2862 while (i < len) {
2863 res += String.fromCharCode.apply(
2864 String,
2865 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
2866 );
2867 }
2868 return res
2869}
2870
2871function asciiSlice (buf, start, end) {
2872 var ret = '';

Callers 1

utf8SliceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected