MCPcopy Index your code
hub / github.com/postcss/postcss / setSourcesContent

Method setSourcesContent

lib/map-generator.js:304–325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

302 }
303
304 setSourcesContent() {
305 let already = {}
306 if (this.root) {
307 this.root.walk(node => {
308 if (node.source) {
309 let from = node.source.input.from
310 if (from && !already[from]) {
311 already[from] = true
312 let fromUrl = this.usesFileUrls
313 ? this.toFileUrl(from)
314 : this.toUrl(this.path(from))
315 this.map.setSourceContent(fromUrl, node.source.input.css)
316 }
317 }
318 })
319 } else if (this.css) {
320 let from = this.opts.from
321 ? this.toUrl(this.path(this.opts.from))
322 : '<no source>'
323 this.map.setSourceContent(from, this.css)
324 }
325 }
326
327 sourcePath(node) {
328 if (this.mapOpts.from) {

Callers 1

generateMapMethod · 0.95

Calls 4

toFileUrlMethod · 0.95
toUrlMethod · 0.95
pathMethod · 0.95
walkMethod · 0.80

Tested by

no test coverage detected