MCPcopy
hub / github.com/webpack/webpack / value

Method value

lib/css/syntax.js:1319–1331  ·  view source on GitHub ↗

* @returns {string} the token's value (raw source slice unless overridden)

()

Source from the content-addressed store, hash-verified

1317 * @returns {string} the token's value (raw source slice unless overridden)
1318 */
1319 get value() {
1320 const input = this._locConverter._input;
1321 const type = this.type;
1322 // hash (`#name` → `name`) and at-keyword (`@name` → `name`) drop one char.
1323 if (type === T_HASH || type === T_AT_KEYWORD) {
1324 return input.slice(this.start + 1, this.end);
1325 }
1326 if (type === T_URL) {
1327 const u = /** @type {UrlToken} */ (/** @type {unknown} */ (this));
1328 return input.slice(u.contentStart, u.contentEnd);
1329 }
1330 return input.slice(this.start, this.end);
1331 }
1332
1333 /**
1334 * The token's value with CSS escapes resolved (`\2d` → `-`, `\75 rl` → `url`),

Callers 8

walkSelectorListMethod · 0.45
handleImportAtRuleMethod · 0.45
walkExportsMethod · 0.45
parseMethod · 0.45
[NodeType.Ident]Method · 0.45

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected