MCPcopy
hub / github.com/webpack/webpack / _ifThreeCodePointsWouldStartAnIdentSequence

Function _ifThreeCodePointsWouldStartAnIdentSequence

lib/css/syntax.js:425–441  ·  view source on GitHub ↗
(input, pos, f, s, t)

Source from the content-addressed store, hash-verified

423 * @returns {boolean} true, if the three code points start an ident sequence
424 */
425const _ifThreeCodePointsWouldStartAnIdentSequence = (input, pos, f, s, t) => {
426 const first = f || input.charCodeAt(pos - 1);
427 const second = s || input.charCodeAt(pos);
428 const third = t || input.charCodeAt(pos + 1);
429 if (first === CC_HYPHEN_MINUS) {
430 return (
431 _isIdentStartCodePointCC(second) ||
432 second === CC_HYPHEN_MINUS ||
433 _ifTwoCodePointsAreValidEscape(input, pos, second, third)
434 );
435 }
436 if (_isIdentStartCodePointCC(first)) return true;
437 if (first === CC_REVERSE_SOLIDUS) {
438 return _ifTwoCodePointsAreValidEscape(input, pos, first, second);
439 }
440 return false;
441};
442
443/**
444 * Spec: "three code points would start a number".

Callers 6

consumeNumberSignFunction · 0.85
consumeHyphenMinusFunction · 0.85
consumeANumericTokenFunction · 0.85
consumeCommercialAtFunction · 0.85
typeFlagMethod · 0.85
syntax.jsFile · 0.85

Calls 2

_isIdentStartCodePointCCFunction · 0.85

Tested by

no test coverage detected