MCPcopy
hub / github.com/tailwindlabs/tailwindcss / updateSource

Function updateSource

packages/@tailwindcss-postcss/src/ast.ts:50–62  ·  view source on GitHub ↗
(astNode: postcss.ChildNode, loc: SourceLocation | undefined)

Source from the content-addressed store, hash-verified

48 }
49
50 function updateSource(astNode: postcss.ChildNode, loc: SourceLocation | undefined) {
51 let source = toSource(loc)
52
53 // The `source` property on PostCSS nodes must be defined if present because
54 // `toJSON()` reads each property and tries to read from source.input if it
55 // sees a `source` property. This means for a missing or otherwise absent
56 // source it must be *missing* from the object rather than just `undefined`
57 if (source) {
58 astNode.source = source
59 } else {
60 delete astNode.source
61 }
62 }
63
64 function transform(node: AstNode, parent: postcss.Container) {
65 // Declaration

Callers 1

transformFunction · 0.85

Calls 1

toSourceFunction · 0.85

Tested by

no test coverage detected