(str, leading, trailing, predicate)
| 4316 | } |
| 4317 | __name(removeASCIIWhitespace, "removeASCIIWhitespace"); |
| 4318 | function removeChars(str, leading, trailing, predicate) { |
| 4319 | let lead = 0; |
| 4320 | let trail = str.length - 1; |
| 4321 | if (leading) { |
| 4322 | while (lead < str.length && predicate(str.charCodeAt(lead))) lead++; |
| 4323 | } |
| 4324 | if (trailing) { |
| 4325 | while (trail > 0 && predicate(str.charCodeAt(trail))) trail--; |
| 4326 | } |
| 4327 | return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1); |
| 4328 | } |
| 4329 | __name(removeChars, "removeChars"); |
| 4330 | function serializeJavascriptValueToJSONString(value) { |
| 4331 | const result = JSON.stringify(value); |
no test coverage detected