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.1.25 to 0.1.26

4

CHANGELOG.md
# Change Log
## 0.1.26
* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70.
## 0.1.25

@@ -4,0 +8,0 @@

2

lib/source-map/source-node.js

@@ -128,3 +128,3 @@ /* -*- Mode: js; js-indent-level: 2; -*- */

function addMappingWithCode(mapping, code) {
if (mapping.source === undefined) {
if (mapping === null || mapping.source === undefined) {
node.add(code);

@@ -131,0 +131,0 @@ } else {

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

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

"Conrad Irwin <conrad.irwin@gmail.com>",
"usrbincc <usrbincc@yahoo.com>"
"usrbincc <usrbincc@yahoo.com>",
"David Glasser <glasser@davidglasser.net>"
],

@@ -22,0 +23,0 @@ "repository": {

@@ -41,3 +41,3 @@ # Source Map

$ node Makefile.dryice.js`
$ node Makefile.dryice.js

@@ -44,0 +44,0 @@ This should create the following files:

@@ -210,2 +210,21 @@ /* -*- Mode: js; js-indent-level: 2; -*- */

exports['test .fromStringWithSourceMap() empty map'] = function (assert, util) {
var node = SourceNode.fromStringWithSourceMap(
util.testGeneratedCode,
new SourceMapConsumer(util.emptyMap));
var result = node.toStringWithSourceMap({
file: 'min.js'
});
var map = result.map;
var code = result.code;
assert.equal(code, util.testGeneratedCode);
assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
map = map.toJSON();
assert.equal(map.version, util.emptyMap.version);
assert.equal(map.file, util.emptyMap.file);
assert.equal(map.mappings.length, util.emptyMap.mappings.length);
assert.equal(map.mappings, util.emptyMap.mappings);
};
exports['test .fromStringWithSourceMap() complex version'] = function (assert, util) {

@@ -212,0 +231,0 @@ var input = new SourceNode(null, null, null, [

@@ -59,3 +59,11 @@ /* -*- Mode: js; js-indent-level: 2; -*- */

};
exports.emptyMap = {
version: 3,
file: 'min.js',
names: [],
sources: [],
mappings: ''
};
function assertMapping(generatedLine, generatedColumn, originalSource,

@@ -62,0 +70,0 @@ originalLine, originalColumn, name, map, assert,

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