MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / removeASCIIWhitespace

Function removeASCIIWhitespace

out/cli.cjs:51710–51720  ·  view source on GitHub ↗
(str2, leading = true, trailing = true)

Source from the content-addressed store, hash-verified

51708 if (trailing) {
51709 for (; trail > 0 && isHTTPWhiteSpace(str2[trail]); trail--) ;
51710 }
51711 return str2.slice(lead, trail + 1);
51712 }
51713 function isASCIIWhitespace(char) {
51714 return char === "\r" || char === "\n" || char === " " || char === "\f" || char === " ";
51715 }
51716 function removeASCIIWhitespace(str2, leading = true, trailing = true) {
51717 let lead = 0;
51718 let trail = str2.length - 1;
51719 if (leading) {
51720 for (; lead < str2.length && isASCIIWhitespace(str2[lead]); lead++) ;
51721 }
51722 if (trailing) {
51723 for (; trail > 0 && isASCIIWhitespace(str2[trail]); trail--) ;

Callers 1

dataURLProcessorFunction · 0.85

Calls 2

isASCIIWhitespaceFunction · 0.85
sliceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…