MCPcopy
hub / github.com/mobxjs/mobx / utf8Slice

Function utf8Slice

docs/assets/getting-started-assets/javascripts/JSXTransformer.js:1022–1037  ·  view source on GitHub ↗
(buf, start, end)

Source from the content-addressed store, hash-verified

1020 }
1021
1022 function utf8Slice(buf, start, end) {
1023 var res = ""
1024 var tmp = ""
1025 end = Math.min(buf.length, end)
1026
1027 for (var i = start; i < end; i++) {
1028 if (buf[i] <= 0x7f) {
1029 res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i])
1030 tmp = ""
1031 } else {
1032 tmp += "%" + buf[i].toString(16)
1033 }
1034 }
1035
1036 return res + decodeUtf8Char(tmp)
1037 }
1038
1039 function asciiSlice(buf, start, end) {
1040 var ret = ""

Callers 1

JSXTransformer.jsFile · 0.85

Calls 2

decodeUtf8CharFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…