MCPcopy Index your code
hub / github.com/callstack/linaria / comment

Method comment

packages/postcss-linaria/src/stringify.ts:99–118  ·  view source on GitHub ↗

@inheritdoc

(node: Comment)

Source from the content-addressed store, hash-verified

97
98 /** @inheritdoc */
99 public override comment(node: Comment): void {
100 const placeholderPattern = new RegExp(`^${placeholderText}:\\d+$`);
101 if (placeholderPattern.test(node.text)) {
102 const [, expressionIndexString] = node.text.split(':');
103 const expressionIndex = Number(expressionIndexString);
104 const root = node.root();
105 const expressionStrings = root.raws.linariaTemplateExpressions;
106
107 if (expressionStrings && !Number.isNaN(expressionIndex)) {
108 const expression = expressionStrings[expressionIndex];
109
110 if (expression) {
111 this.builder(expression, node);
112 return;
113 }
114 }
115 }
116
117 super.comment(node);
118 }
119
120 public override decl(node: Declaration, semicolon: boolean): void {
121 const between = this.raw(node, 'between', 'colon');

Callers

nothing calls this directly

Calls 1

rootMethod · 0.80

Tested by

no test coverage detected