Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 15, 2024 via pnpm

@ampproject/remapping 2.2.1

Remap sequential sourcemaps through transformations to point at the original source code
Package summary
Share
0
issues
2
licenses
5
MIT
1
Apache-2.0
Package created
8 Aug 2019
Version published
7 Apr 2023
Maintainers
2
Total deps
6
Direct deps
2
License
Apache-2.0

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
5 Packages, Including:
@jridgewell/gen-mapping@0.3.5
@jridgewell/resolve-uri@3.1.2
@jridgewell/set-array@1.2.1
@jridgewell/sourcemap-codec@1.4.15
@jridgewell/trace-mapping@0.3.25

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
1 Packages, Including:
@ampproject/remapping@2.2.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of @ampproject/remapping 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@jridgewell/gen-mapping0.3.579.68 kBMIT
prod
@jridgewell/trace-mapping0.3.25165.36 kBMIT
prod

Visualizations

Frequently Asked Questions

What does @ampproject/remapping do?

The "@ampproject/remapping" is an npm package available at the URL git+https://github.com/ampproject/remapping.git. This JavaScript tool enables developers to remap sequential sourcemaps through transformations to reference the original source code. When your code is subjected to transformations like minification, bundling with webpack, or Babel transpilation, the resultant sourcemaps can still point to the correct locations in your original code. This greatly simplifies the process of building custom transformations.

How do you use @ampproject/remapping?

Utilizing "@ampproject/remapping" requires the installation of the package through npm, which can be accomplished by running npm install @ampproject/remapping. Once installed, you typically use it through a remapping function that takes the final output sourcemap and a loader function as parameters. For every source file pointer in the sourcemap, the loader will be invoked with the resolved path. If the path represents a transformed file with its own sourcemap, the loader should return this sourcemap. Otherwise, the path will be treated as an original, untransformed source code location.

Here's a simple example of how you use "@ampproject/remapping" in your JavaScript:

function remapping(
  map: SourceMap | SourceMap[],
  loader: (file: string, ctx: LoaderContext) => (SourceMap | null | undefined),
  options?: { excludeContent: boolean, decodedMappings: boolean }
): SourceMap;

The map parameter is the final output sourcemap. The loader function will be called for every source file pointer in the sourcemap, and if the file path represents a transformed file, then the loader should return that sourcemap.

const remapped = remapping(
  minifiedTransformedMap,
  (file, ctx) => {
    if (file === 'transformed.js') {
      return transformedMap;
    }
    return null;
  }
);
console.log(remapped);

Where are the @ampproject/remapping docs?

The "@ampproject/remapping" documentation is included within the project's README file in its GitHub repository which can be accessed at https://github.com/ampproject/remapping. The README provides information about installation, usage examples, options and parameters related to the packages' features. The comprehensive documentation can guide developers through using the package effectively in their own projects. It serves as a valuable resource for gaining insights into the package's functionality and utilization.