MCPcopy Index your code
hub / github.com/nodejs/node / charLengthLeft

Function charLengthLeft

lib/internal/readline/utils.js:39–48  ·  view source on GitHub ↗
(str, i)

Source from the content-addressed store, hash-verified

37// Check Canonical_Combining_Class in
38// http://userguide.icu-project.org/strings/properties
39function charLengthLeft(str, i) {
40 if (i <= 0)
41 return 0;
42 if ((i > 1 &&
43 StringPrototypeCodePointAt(str, i - 2) >= kUTF16SurrogateThreshold) ||
44 StringPrototypeCodePointAt(str, i - 1) >= kUTF16SurrogateThreshold) {
45 return 2;
46 }
47 return 1;
48}
49
50function charLengthAt(str, i) {
51 if (str.length <= i) {

Callers 2

[kDeleteLeft]Method · 0.85
[kTtyWrite]Method · 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…