MCPcopy Create free account
hub / github.com/angular/dev-infra / removeChars

Function removeChars

github-actions/saucelabs/set-saucelabs-env.js:3715–3727  ·  view source on GitHub ↗
(str, leading, trailing, predicate)

Source from the content-addressed store, hash-verified

3713 function removeHTTPWhitespace(str, leading = true, trailing = true) {
3714 return removeChars(str, leading, trailing, isHTTPWhiteSpace);
3715 }
3716 function isASCIIWhitespace(char) {
3717 return char === 13 || char === 10 || char === 9 || char === 12 || char === 32;
3718 }
3719 function removeASCIIWhitespace(str, leading = true, trailing = true) {
3720 return removeChars(str, leading, trailing, isASCIIWhitespace);
3721 }
3722 function removeChars(str, leading, trailing, predicate) {
3723 let lead = 0;
3724 let trail = str.length - 1;
3725 if (leading) {
3726 while (lead < str.length && predicate(str.charCodeAt(lead)))
3727 lead++;
3728 }
3729 if (trailing) {
3730 while (trail > 0 && predicate(str.charCodeAt(trail)))

Callers 4

removeHTTPWhitespaceFunction · 0.70
removeASCIIWhitespaceFunction · 0.70
gettingDecodingSplittingFunction · 0.70

Calls 1

sliceMethod · 0.45

Tested by

no test coverage detected