MCPcopy Index your code
hub / github.com/plotly/plotly.js / decodeCodePointsArray

Function decodeCodePointsArray

stackgl_modules/index.js:902–915  ·  view source on GitHub ↗
(codePoints)

Source from the content-addressed store, hash-verified

900// We go 1 magnitude less, for safety
901var MAX_ARGUMENTS_LENGTH = 0x1000;
902function decodeCodePointsArray(codePoints) {
903 var len = codePoints.length;
904 if (len <= MAX_ARGUMENTS_LENGTH) {
905 return String.fromCharCode.apply(String, codePoints); // avoid extra slice()
906 }
907
908 // Decode in chunks to avoid "call stack size exceeded".
909 var res = '';
910 var i = 0;
911 while (i < len) {
912 res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
913 }
914 return res;
915}
916function asciiSlice(buf, start, end) {
917 var ret = '';
918 end = Math.min(buf.length, end);

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…