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
applySourceMaps(x, mapFn) =>
-
Promise<string>
createDeferredCache<T, U>(fn) =>
# fetch
(input, init)
src/fetch-source-map.ts#L17 # fetchSourceMap
(key, args)
src/fetch-source-map.ts#L23 # getCodeFrame
(message, { column, line, originalUrl, url })
src/get-code-frame.ts#L4
# message
string
}
getCodeFrame(message, { column, line, originalUrl, url }) =>
-
Promise<undefined | string>
# getIt
(key, args)
src/get-real-location-from-line-col.ts#L13
# key
string
# args
[ RealLocation ]
getIt(key, args) =>
-
Promise<void | RealLocation>
# getRealLocationFromUrlLineCol
(real)
src/get-real-location-from-line-col.ts#L36
# real
getRealLocationFromUrlLineCol(real) =>
-
Promise<void | RealLocation>
# getSourceMap
(url, content)
src/get-source-map.ts#L9 # log
(formatter, args)
src/apply-sourcemaps.ts#L5 Credits
- @babel/code-frame by The Babel Team – Generate errors that contain a code frame that point to source locations.
- convert-source-map by Thorsten Lorenz – Converts a source-map from/to different formats and allows adding/changing properties.
- debug by Josh Junon – Lightweight debugging utility for Node.js and the browser
- everyday-utils by stagas – Everyday utilities
- fetch-h2 by Gustaf Räntilä – HTTP/1+2 Fetch API client for Node.js
- source-map by Nick Fitzgerald – Generates and consumes source maps
Contributing
All contributions are welcome!