apply-sourcemaps
Fetch and apply sourcemaps in logs and stack traces originating from the browser or puppeteer.
npm i apply-sourcemaps
|
pnpm add apply-sourcemaps
|
yarn add apply-sourcemaps
|
API
# getRealLocationFromUrlLineCol
src/get-real-location-from-line-col.ts#L36 # RealLocation
src/get-real-location-from-line-col.ts#L4 # Sources
src/fetch-source-map.ts#L10 # applySourceMaps
(x, mapFn)
src/apply-sourcemaps.ts#L14
# x
# mapFn
(url)
applySourceMaps(x, mapFn) =>
# clearAllCaches
()
src/util.ts#L5 # createDeferredCache
(fn)
src/util.ts#L11
# fn
(id, rest)
# id
# rest
fn(id, rest) =>
createDeferredCache<T, U>(fn) =>
# (key, args)
# key
# args
(key, args) =>
# fetch
(input, init)
src/fetch-source-map.ts#L17
# input
# init
fetch(input, init) =>
# fetchSourceMap
(key, args)
src/fetch-source-map.ts#L23
# key
# args
fetchSourceMap(key, args) =>
# getCodeFrame
(message, { column, line, originalUrl, url })
src/get-code-frame.ts#L4 # getIt
(key, args)
src/get-real-location-from-line-col.ts#L13
# key
# args
getIt(key, args) =>
# getRealLocationFromUrlLineCol
(real)
src/get-real-location-from-line-col.ts#L36 # getSourceMap
(url, content)
src/get-source-map.ts#L9
# url
# content
getSourceMap(url, content) =>
# log
(formatter, args)
src/apply-sourcemaps.ts#L5
# formatter
# args
log(formatter, args) =>
# parseUrls
(x)
src/parse-urls.ts#L5
Credits
Contributing
Fork or edit and submit a PR.
All contributions are welcome!
License
MIT © 2022 stagas