MCPcopy
hub / github.com/postcss/postcss / toUrl

Method toUrl

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

Source from the content-addressed store, hash-verified

359 }
360
361 toUrl(path) {
362 let cached = this.memoizedURLs.get(path)
363 if (cached) return cached
364
365 if (sep === '\\') {
366 path = path.replace(/\\/g, '/')
367 }
368
369 let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent)
370 this.memoizedURLs.set(path, url)
371
372 return url
373 }
374}
375
376module.exports = MapGenerator

Callers 4

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

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected