MCPcopy
hub / github.com/tailwindlabs/prettier-plugin-tailwindcss / String

Function String

src/index.ts:353–371  ·  view source on GitHub ↗
(node: any)

Source from the content-addressed store, hash-verified

351 ) {
352 visit(node.markup.expression, {
353 String(node: any) {
354 let pos = { ...node.position }
355
356 // We have to offset the position ONLY when quotes are part of the String node
357 // This is because `value` does NOT include quotes
358 if (hasSurroundingQuotes(node.source.slice(pos.start, pos.end))) {
359 pos.start += 1
360 pos.end -= 1
361 }
362
363 let after = sortClasses(node.value, { env })
364
365 changes.push({
366 start: pos.start,
367 end: pos.end,
368 before: node.value,
369 after,
370 })
371 },
372 })
373 }
374 }

Callers

nothing calls this directly

Calls 2

hasSurroundingQuotesFunction · 0.85
sortClassesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…