apply-sourcemaps
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

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

      string

    # mapFn(url)

      # url

        string

      mapFn(url)  =>

        string

applySourceMaps(x, mapFn)  =>

    Promise<string>
# clearAllCaches() src/util.ts#L5

    clearAllCaches()  =>

      void
# createDeferredCache(fn) src/util.ts#L11

    # fn(id, rest)

      # id

        string

      # rest

      fn(id, rest)  =>

        Promise<T>

createDeferredCache<T, U>(fn)  =>

    # (key, args)

      # key

        string

      # args

      (key, args)  =>

        Promise<T>
# fetch(input, init) src/fetch-source-map.ts#L17

    # input

      string | Request

    # init

      Partial<FetchInit>

    fetch(input, init)  =>

      Promise<Response>
# fetchSourceMap(key, args) src/fetch-source-map.ts#L23

    # key

      string

    # 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
# getRealLocationFromUrlLineCol(real) src/get-real-location-from-line-col.ts#L36
# getSourceMap(url, content) src/get-source-map.ts#L9

    # url

      string

    # content

      string

    getSourceMap(url, content)  =>

      Promise<undefined | RawSourceMap>
# log(formatter, args) src/apply-sourcemaps.ts#L5

    # formatter

      any

    # args

      any []

    log(formatter, args)  =>

      void
# parseUrls(x) src/parse-urls.ts#L5

Credits

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas

Readme

Keywords

none

Package Sidebar

Install

npm i apply-sourcemaps

Weekly Downloads

77

Version

1.3.0

License

MIT

Unpacked Size

2.76 MB

Total Files

53

Last publish

Collaborators

  • stagas