Socket
Socket
Sign inDemoInstall

sourcemap-validator

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sourcemap-validator - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

yarn.lock

13

index.js

@@ -8,3 +8,4 @@ var validate

, template = require('lodash.template')
, jsesc = require('jsesc');
, jsesc = require('jsesc')
, fancyArrow = String.fromCharCode(parseInt(2192,16));

@@ -89,5 +90,3 @@ // Lifted from UglifyJS

, errMsg
, mapRef = template('<%=generatedLine%>:<%=generatedColumn%>'
+ String.fromCharCode(parseInt(2192,16)) // Fancy arrow!
+ '<%=originalLine%>:<%=originalColumn%> "<%=name%>" in <%=source%>')(mapping)
, mapRef
, expected

@@ -98,4 +97,5 @@ , actuals = []

if(mapping.name) {
if(!splitSrcs[mapping.source])
if(!splitSrcs[mapping.source]) {
throw new Error(mapping.source + ' not found in ' + Object.keys(splitSrcs).join(', '));
}

@@ -131,2 +131,5 @@ originalLine = splitSrcs[mapping.source][mapping.originalLine - 1];

if(!success) {
mapRef = template('<%=generatedLine%>:<%=generatedColumn%>'
+ fancyArrow
+ '<%=originalLine%>:<%=originalColumn%> "<%=name%>" in <%=source%>')(mapping);
errMsg = template(''

@@ -133,0 +136,0 @@ + 'Warning: mismatched names\n'

@@ -21,3 +21,3 @@ {

],
"version": "1.0.6",
"version": "1.0.7",
"repository": {

@@ -24,0 +24,0 @@ "type": "git",

@@ -26,8 +26,7 @@ sourcemap-validator

, assert = require('assert')
, raw = fs.readFileSync('jquery.js')
, min = fs.readFileSync('jquery.min.js')
, map = fs.readFileSync('jquery.min.map');
, min = fs.readFileSync('jquery.min.js', 'utf-8')
, map = fs.readFileSync('jquery.min.map', 'utf-8');
assert.doesNotThrow(function () {
validate({'jquery.js': raw}, min, map);
validate(min, map, {'jquery.js': raw});
}, 'The sourcemap is not valid');

@@ -40,9 +39,9 @@ ```

, assert = require('assert')
, min = fs.readFileSync('bundle.min.js')
, map = fs.readFileSync('bundle.min.map');
, min = fs.readFileSync('bundle.min.js', 'utf-8')
, map = fs.readFileSync('bundle.min.map', 'utf-8');
// Browserify bundles have inline sourceContent in their maps
// so pass an emtpy object as the first argument.
// so no need to pass a `sourceContent` object.
assert.doesNotThrow(function () {
validate({}, min, map);
validate(min, map);
}, 'The sourcemap is not valid');

@@ -49,0 +48,0 @@ ```

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