Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

source-map

Package Overview
Dependencies
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

source-map - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

dist/source-map.js

9

CHANGELOG.md
# Change Log
## 0.4.2
* Add an `.npmignore` file so that the benchmarks aren't pulled down by
dependent projects. Issue #169.
* Add an optional `column` argument to
`SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines
with no mappings. Issues #172 and #173.
## 0.4.1

@@ -4,0 +13,0 @@

34

lib/source-map/source-map-consumer.js

@@ -166,8 +166,12 @@ /* -*- Mode: js; js-indent-level: 2; -*- */

/**
* Returns all generated line and column information for the original source
* and line provided. The only argument is an object with the following
* properties:
* Returns all generated line and column information for the original source,
* line, and column provided. If no column is provided, returns all mappings
* corresponding to a single line. Otherwise, returns all mappings
* corresponding to a single line and column.
*
* The only argument is an object with the following properties:
*
* - source: The filename of the original source.
* - line: The line number in the original source.
* - column: Optional. the column number in the original source.
*

@@ -183,8 +187,8 @@ * and an array of objects is returned, each with the following properties:

// returns the index of the closest mapping less than the needle. By
// setting needle.originalColumn to Infinity, we thus find the last
// mapping for the given line, provided such a mapping exists.
// setting needle.originalColumn to 0, we thus find the last mapping for
// the given line, provided such a mapping exists.
var needle = {
source: util.getArg(aArgs, 'source'),
originalLine: util.getArg(aArgs, 'line'),
originalColumn: 0
originalColumn: util.getArg(aArgs, 'column', 0)
};

@@ -206,2 +210,4 @@

var mapping = this._originalMappings[index];
var originalLine = mapping.originalLine;
var originalColumn = mapping.originalColumn;

@@ -211,3 +217,5 @@ // Iterate until either we run out of mappings, or we run into

// guaranteed to find all mappings for the line we are searching for.
while (mapping && mapping.originalLine === needle.originalLine) {
while (mapping && mapping.originalLine === originalLine &&
(aArgs.column === undefined ||
mapping.originalColumn === originalColumn)) {
mappings.push({

@@ -648,7 +656,9 @@ line: util.getArg(mapping, 'generatedLine', null),

return {
line: util.getArg(mapping, 'generatedLine', null),
column: util.getArg(mapping, 'generatedColumn', null),
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
};
if (mapping.source === needle.source) {
return {
line: util.getArg(mapping, 'generatedLine', null),
column: util.getArg(mapping, 'generatedColumn', null),
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
};
}
}

@@ -655,0 +665,0 @@

{
"name": "source-map",
"description": "Generates and consumes source maps",
"version": "0.4.1",
"version": "0.4.2",
"homepage": "https://github.com/mozilla/source-map",

@@ -38,3 +38,4 @@ "author": "Nick Fitzgerald <nfitzgerald@mozilla.com>",

"Jamie Wong <jamie.lf.wong@gmail.com>",
"Eddy Bruël <ejpbruel@mozilla.com>"
"Eddy Bruël <ejpbruel@mozilla.com>",
"Hawken Rives <hawkrives@gmail.com>"
],

@@ -41,0 +42,0 @@ "repository": {

@@ -240,6 +240,9 @@ # Source Map

Returns all generated line and column information for the original source
and line provided. The only argument is an object with the following
properties:
Returns all generated line and column information for the original source,
line, and column provided. If no column is provided, returns all mappings
corresponding to a single line. Otherwise, returns all mappings corresponding to
a single line and column.
The only argument is an object with the following properties:
* `source`: The filename of the original source.

@@ -249,2 +252,4 @@

* `column`: Optional. The column number in the original source.
and an array of objects is returned, each with the following properties:

@@ -251,0 +256,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc