Socket
Socket
Sign inDemoInstall

@jridgewell/trace-mapping

Package Overview
Dependencies
2
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.10 to 0.3.11

13

dist/trace-mapping.umd.js

@@ -342,2 +342,6 @@ (function (global, factory) {

/**
* Retrieves the source content for a particular source, if its found. Returns null if not.
*/
exports.sourceContentFor = void 0;
/**
* A helper that skips sorting of the input map's mappings array, which can be expensive for larger

@@ -487,2 +491,11 @@ * maps.

};
exports.sourceContentFor = (map, source) => {
const { sources, resolvedSources, sourcesContent } = map;
if (sourcesContent == null)
return null;
let index = sources.indexOf(source);
if (index === -1)
index = resolvedSources.indexOf(source);
return index === -1 ? null : sourcesContent[index];
};
exports.presortedDecodedMap = (map, mapUrl) => {

@@ -489,0 +502,0 @@ const clone = Object.assign({}, map);

4

dist/types/trace-mapping.d.ts

@@ -39,2 +39,6 @@ import type { SourceMapSegment } from './sourcemap-segment';

/**
* Retrieves the source content for a particular source, if its found. Returns null if not.
*/
export declare let sourceContentFor: (map: TraceMap, source: string) => string | null;
/**
* A helper that skips sorting of the input map's mappings array, which can be expensive for larger

@@ -41,0 +45,0 @@ * maps.

2

package.json
{
"name": "@jridgewell/trace-mapping",
"version": "0.3.10",
"version": "0.3.11",
"description": "Trace the original position through a source map",

@@ -5,0 +5,0 @@ "keywords": [

@@ -20,3 +20,8 @@ # @jridgewell/trace-mapping

```typescript
import { TraceMap, originalPositionFor, generatedPositionFor } from '@jridgewell/trace-mapping';
import {
TraceMap,
originalPositionFor,
generatedPositionFor,
sourceContentFor,
} from '@jridgewell/trace-mapping';

@@ -26,2 +31,3 @@ const tracer = new TraceMap({

sources: ['input.js'],
sourcesContent: ['content of input.js'],
names: ['foo'],

@@ -40,2 +46,5 @@ mappings: 'KAyCIA',

const content = sourceContentFor(tracer, traced.source);
assert.strictEqual(content, 'content for input.js');
const generated = generatedPositionFor(tracer, {

@@ -42,0 +51,0 @@ source: 'input.js',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc