squishjs 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Asset.js +5 -2
package/package.json
CHANGED
package/src/Asset.js
CHANGED
|
@@ -157,14 +157,17 @@ class Asset {
|
|
|
157
157
|
const filePath = `${path}/${fileHash}`;
|
|
158
158
|
|
|
159
159
|
const writeStream = this.fs.createWriteStream(filePath);
|
|
160
|
-
const getModule = this.https;
|
|
161
160
|
|
|
162
161
|
writeStream.on('close', () => {
|
|
163
162
|
resolve(filePath);
|
|
164
163
|
});
|
|
165
164
|
|
|
166
165
|
let data = '';
|
|
167
|
-
|
|
166
|
+
const assetSource = this.info?.source? || 'https://assets.homegames.io';
|
|
167
|
+
|
|
168
|
+
const getModule = assetSource.startsWith('https') ? this.https : this.http;
|
|
169
|
+
|
|
170
|
+
getModule.get(`${assetSource}/${assetId}`, (res) => {
|
|
168
171
|
res.on('data', (chunk) => {
|
|
169
172
|
data += chunk;
|
|
170
173
|
writeStream.write(chunk);
|