MCPcopy
hub / github.com/postcss/postcss / path

Method path

lib/map-generator.js:264–281  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

262 }
263
264 path(file) {
265 if (this.mapOpts.absolute) return file
266 if (file.charCodeAt(0) === 60 /* `<` */) return file
267 if (/^\w+:\/\//.test(file)) return file
268 let cached = this.memoizedPaths.get(file)
269 if (cached) return cached
270
271 let from = this.opts.to ? dirname(this.opts.to) : '.'
272
273 if (typeof this.mapOpts.annotation === 'string') {
274 from = dirname(resolve(from, this.mapOpts.annotation))
275 }
276
277 let path = relative(from, file)
278 this.memoizedPaths.set(file, path)
279
280 return path
281 }
282
283 previous() {
284 if (!this.previousMaps) {

Callers 5

applyPrevMapsMethod · 0.95
generateMapMethod · 0.95
outputFileMethod · 0.95
setSourcesContentMethod · 0.95
sourcePathMethod · 0.95

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected