webpack-sources
Advanced tools
Comparing version 2.0.0-beta.3 to 2.0.0-beta.4
@@ -32,3 +32,10 @@ /* | ||
} | ||
return (this._cachedBuffer = this._source.buffer()); | ||
if (typeof this._source.buffer === "function") { | ||
return (this._cachedBuffer = this._source.buffer()); | ||
} | ||
const bufferOrString = this.source(); | ||
if (Buffer.isBuffer(bufferOrString)) { | ||
return (this._cachedBuffer = bufferOrString); | ||
} | ||
return (this._cachedBuffer = Buffer.from(bufferOrString, "utf-8")); | ||
} | ||
@@ -35,0 +42,0 @@ |
@@ -52,3 +52,3 @@ /* | ||
} | ||
} else { | ||
} else if (typeof child.buffer === "function") { | ||
if (currentString !== undefined) { | ||
@@ -59,2 +59,17 @@ buffers.push(Buffer.from(currentString, "utf-8")); | ||
buffers.push(child.buffer()); | ||
} else { | ||
const bufferOrString = child.source(); | ||
if (Buffer.isBuffer(bufferOrString)) { | ||
if (currentString !== undefined) { | ||
buffers.push(Buffer.from(currentString, "utf-8")); | ||
currentString = undefined; | ||
} | ||
buffers.push(bufferOrString); | ||
} else { | ||
if (currentString === undefined) { | ||
currentString = bufferOrString; | ||
} else { | ||
currentString += bufferOrString; | ||
} | ||
} | ||
} | ||
@@ -61,0 +76,0 @@ } |
{ | ||
"name": "webpack-sources", | ||
"version": "2.0.0-beta.3", | ||
"version": "2.0.0-beta.4", | ||
"description": "Source code handling classes for webpack", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
40267
1180