MCPcopy Index your code
hub / github.com/danvk/webdiff / charType

Function charType

ts/codediff/char-diffs.ts:116–122  ·  view source on GitHub ↗
(c: string)

Source from the content-addressed store, hash-verified

114 WS = 4,
115 SYM = 5;
116 const charType = function (c: string) {
117 if (/[a-z]/.exec(c)) return LC;
118 if (/[A-Z]/.exec(c)) return UC;
119 if (/[0-9]/.exec(c)) return NUM;
120 if (/\s/.exec(c)) return WS;
121 return SYM;
122 };
123
124 // Single words can be [A-Z][a-z]+, [A-Z]+, [a-z]+, [0-9]+ or \s+.
125 const words = [];

Callers 1

splitIntoWordsFunction · 0.85

Calls 1

execMethod · 0.45

Tested by

no test coverage detected