Socket
Socket
Sign inDemoInstall

webpack-sources

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-sources - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

npm-debug.log.18166252

5

lib/ConcatSource.js

@@ -58,4 +58,7 @@ /*

this.children.forEach(function(item) {
item.updateHash(hash);
if(typeof item === "string")
hash.update(item);
else
item.updateHash(hash);
});
};

2

package.json
{
"name": "webpack-sources",
"version": "0.1.2",
"version": "0.1.3",
"description": "Source code handling classes for webpack",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -65,2 +65,43 @@ var should = require("should");

});
it('should be able to handle strings for all methods', function() {
var source = new ConcatSource(
new RawSource("Hello World\n"),
new OriginalSource("console.log('test');\nconsole.log('test2');\n", "console.js")
);
source.add("console.log('string')");
var expectedSource = [
"Hello World",
"console.log('test');",
"console.log('test2');",
"console.log('string')",
].join("\n");
var expectedMap1 = {
version: 3,
file: "x",
mappings: ";AAAA;AACA;",
sources: [
"console.js"
],
sourcesContent: [
"console.log('test');\nconsole.log('test2');\n",
]
};
source.size().should.be.eql(76);
source.source().should.be.eql(expectedSource);
source.map({
columns: false
}).should.be.eql(expectedMap1);
source.sourceAndMap({
columns: false
}).should.be.eql({
source: expectedSource,
map: expectedMap1
});
var hash = require('crypto').createHash('sha256')
source.updateHash(hash)
var digest = hash.digest('hex')
digest.should.be.eql('c7172c1aa78e1ab61b365fadb9b6f192a770c2b91c8b5c65314b4911431a1a31')
})
});
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