webpack-sources
Advanced tools
Comparing version 2.0.0-beta.4 to 2.0.0-beta.5
@@ -158,2 +158,3 @@ /* | ||
updateHash(hash) { | ||
hash.update("ConcatSource"); | ||
const children = this.children; | ||
@@ -160,0 +161,0 @@ for (let i = 0; i < children.length; i++) { |
@@ -80,2 +80,3 @@ /* | ||
hash.update(this._value); | ||
hash.update(this._name || ""); | ||
} | ||
@@ -82,0 +83,0 @@ } |
@@ -26,4 +26,8 @@ /* | ||
this._sourceMap = sourceMap; | ||
this._sourceMapObject = undefined; | ||
this._sourceMapString = undefined; | ||
this._originalSource = originalSource; | ||
this._innerSourceMap = innerSourceMap; | ||
this._innerSourceMapObject = undefined; | ||
this._innerSourceMapString = undefined; | ||
this._removeOriginalSource = removeOriginalSource; | ||
@@ -38,5 +42,9 @@ } | ||
if (!this._innerSourceMap) { | ||
return typeof this._sourceMap === "string" | ||
? JSON.parse(this._sourceMap) | ||
: this._sourceMap; | ||
return ( | ||
this._sourceMapObject || | ||
(this._sourceMapObject = | ||
typeof this._sourceMap === "string" | ||
? JSON.parse(this._sourceMap) | ||
: this._sourceMap) | ||
); | ||
} | ||
@@ -51,5 +59,7 @@ return getMap(this, options); | ||
map: | ||
typeof this._sourceMap === "string" | ||
? JSON.parse(this._sourceMap) | ||
: this._sourceMap | ||
this._sourceMapObject || | ||
(this._sourceMapObject = | ||
typeof this._sourceMap === "string" | ||
? JSON.parse(this._sourceMap) | ||
: this._sourceMap) | ||
}; | ||
@@ -61,3 +71,8 @@ } | ||
node(options) { | ||
const sourceMap = this._sourceMap; | ||
const sourceMap = | ||
this._sourceMapObject || | ||
(this._sourceMapObject = | ||
typeof this._sourceMap === "string" | ||
? JSON.parse(this._sourceMap) | ||
: this._sourceMap); | ||
let node = SourceNode.fromStringWithSourceMap( | ||
@@ -68,4 +83,9 @@ this._value, | ||
node.setSourceContent(this._name, this._originalSource); | ||
const innerSourceMap = this._innerSourceMap; | ||
if (innerSourceMap) { | ||
if (this._innerSourceMap) { | ||
const innerSourceMap = | ||
this._innerSourceMapObject || | ||
(this._innerSourceMapObject = | ||
typeof this._innerSourceMap === "string" | ||
? JSON.parse(this._innerSourceMap) | ||
: this._innerSourceMap); | ||
node = applySourceMap( | ||
@@ -85,13 +105,40 @@ node, | ||
return new SourceListMap(this._value, this._name, this._value); | ||
return fromStringWithSourceMap( | ||
this._value, | ||
typeof this._sourceMap === "string" | ||
? JSON.parse(this._sourceMap) | ||
: this._sourceMap | ||
); | ||
const sourceMap = | ||
this._sourceMapObject || | ||
(this._sourceMapObject = | ||
typeof this._sourceMap === "string" | ||
? JSON.parse(this._sourceMap) | ||
: this._sourceMap); | ||
return fromStringWithSourceMap(this._value, sourceMap); | ||
} | ||
updateHash(hash) { | ||
hash.update("SourceMapSource"); | ||
hash.update(this._value); | ||
if (this._originalSource) hash.update(this._originalSource); | ||
const sourceMap = | ||
this._sourceMapString || | ||
(this._sourceMapString = | ||
typeof this._sourceMap === "string" | ||
? this._sourceMap | ||
: JSON.stringify(this._sourceMap)); | ||
hash.update(sourceMap); | ||
if (this._originalSource) { | ||
hash.update(this._originalSource); | ||
} | ||
if (this._innerSourceMap) { | ||
const innerSourceMap = | ||
this._innerSourceMapString || | ||
(this._innerSourceMapString = | ||
typeof this._innerSourceMap === "string" | ||
? this._innerSourceMap | ||
: JSON.stringify(this._innerSourceMap)); | ||
hash.update(innerSourceMap); | ||
} | ||
hash.update(this._removeOriginalSource ? "true" : "false"); | ||
} | ||
@@ -98,0 +145,0 @@ } |
{ | ||
"name": "webpack-sources", | ||
"version": "2.0.0-beta.4", | ||
"version": "2.0.0-beta.5", | ||
"description": "Source code handling classes for webpack", | ||
@@ -36,3 +36,3 @@ "main": "./lib/index.js", | ||
"engines": { | ||
"node": ">=6.11.5" | ||
"node": ">=10.13.0" | ||
}, | ||
@@ -39,0 +39,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41622
1223