Socket
Socket
Sign inDemoInstall

webpack-sources

Package Overview
Dependencies
Maintainers
5
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 2.1.1 to 2.2.0

38

lib/CachedSource.js

@@ -46,2 +46,3 @@ /*

this._cachedMaps = cachedData ? cachedData.maps : new Map();
this._cachedHashUpdate = cachedData ? cachedData.hash : undefined;
}

@@ -78,3 +79,4 @@

size: this._cachedSize,
maps: bufferedMaps
maps: bufferedMaps,
hash: this._cachedHashUpdate
};

@@ -180,3 +182,35 @@ }

updateHash(hash) {
this.original().updateHash(hash);
if (this._cachedHashUpdate !== undefined) {
for (const item of this._cachedHashUpdate) hash.update(item);
return;
}
const update = [];
let currentString = undefined;
const tracker = {
update: item => {
if (typeof item === "string" && item.length < 10240) {
if (currentString === undefined) {
currentString = item;
} else {
currentString += item;
if (currentString > 102400) {
update.push(Buffer.from(currentString));
currentString = undefined;
}
}
} else {
if (currentString !== undefined) {
update.push(Buffer.from(currentString));
currentString = undefined;
}
update.push(item);
}
}
};
this.original().updateHash(tracker);
if (currentString !== undefined) {
update.push(Buffer.from(currentString));
}
for (const item of update) hash.update(item);
this._cachedHashUpdate = update;
}

@@ -183,0 +217,0 @@ }

2

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

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

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