MCPcopy
hub / github.com/webpack/webpack / skipWhiteLine

Function skipWhiteLine

lib/css/CssParser.js:505–526  ·  view source on GitHub ↗
(input, pos)

Source from the content-addressed store, hash-verified

503 * @returns {number} position past whitespace + one newline
504 */
505const skipWhiteLine = (input, pos) => {
506 for (;;) {
507 const cc = input.charCodeAt(pos);
508 if (cc === CC_SPACE || cc === CC_TAB) {
509 pos++;
510 continue;
511 }
512 if (
513 cc === CC_LINE_FEED ||
514 cc === CC_CARRIAGE_RETURN ||
515 cc === CC_FORM_FEED
516 ) {
517 pos++;
518 }
519 // Treat CRLF as one newline: a CR followed by LF advances past the LF.
520 if (cc === CC_CARRIAGE_RETURN && input.charCodeAt(pos) === CC_LINE_FEED) {
521 pos++;
522 }
523 break;
524 }
525 return pos;
526};
527
528/**
529 * Whether the ident byte-range is a `@container` prelude keyword (`none`/`and`/`or`/`not`, lowercase only) — byte comparison avoids slicing a transient string per prelude ident.

Callers 2

processImportOrExportMethod · 0.85
handleImportAtRuleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected