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

Function endsWith

test/fixtures/snapshot/typescript.js:2278–2281  ·  view source on GitHub ↗
(str, suffix)

Source from the content-addressed store, hash-verified

2276 return res > max ? undefined : res;
2277 }
2278 function endsWith(str, suffix) {
2279 var expectedPos = str.length - suffix.length;
2280 return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
2281 }
2282 ts.endsWith = endsWith;
2283 function removeSuffix(str, suffix) {
2284 return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str;

Callers 3

removeSuffixFunction · 0.70
tryRemoveSuffixFunction · 0.70
isPatternMatchFunction · 0.70

Calls 1

indexOfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…