MCPcopy
hub / github.com/postcss/postcss / toFileUrl

Method toFileUrl

lib/map-generator.js:345–359  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

343 }
344
345 toFileUrl(path) {
346 let cached = this.memoizedFileURLs.get(path)
347 if (cached) return cached
348
349 if (pathToFileURL) {
350 let fileURL = pathToFileURL(path).toString()
351 this.memoizedFileURLs.set(path, fileURL)
352
353 return fileURL
354 } else {
355 throw new Error(
356 '`map.absolute` option is not available in this PostCSS build'
357 )
358 }
359 }
360
361 toUrl(path) {
362 let cached = this.memoizedURLs.get(path)

Callers 2

setSourcesContentMethod · 0.95
sourcePathMethod · 0.95

Calls 3

getMethod · 0.45
toStringMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected