MCPcopy
hub / github.com/webpack/webpack / tokenToNode

Function tokenToNode

lib/css/syntax.js:1863–1872  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

1861 * @returns {Node} the leaf token node
1862 */
1863const tokenToNode = (t) => {
1864 const tt = t.type;
1865 // URL is the only leaf with own state (its content range); all others are a
1866 // plain leaf whose node type comes from the map.
1867 if (tt === TT_URL) {
1868 const ut = /** @type {CssUrlToken} */ (t);
1869 return _mkUrl(t.start, t.end, ut.contentStart, ut.contentEnd);
1870 }
1871 return _mkLeaf(_ttToNodeType[tt], t.start, t.end);
1872};
1873
1874/**
1875 * Position-based view over the lexer — webpack's stand-in for the spec's

Callers 2

consumeATokenAsNodeFunction · 0.85
consumeAComponentValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected