squishjs 1.1.1 → 1.1.2
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 +7 -7
package/package.json
CHANGED
package/src/Asset.js
CHANGED
|
@@ -166,16 +166,15 @@ class Asset {
|
|
|
166
166
|
resolve(filePath);
|
|
167
167
|
});
|
|
168
168
|
|
|
169
|
-
let data = '';
|
|
170
169
|
getModule.get(`${ASSET_URL}/${assetId}`, (res) => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
writeStream.write(chunk);
|
|
174
|
-
});
|
|
175
|
-
res.on('end', () => {
|
|
176
|
-
writeStream.end();
|
|
170
|
+
writeStream.on('finish', () => {
|
|
171
|
+
writeStream.close();
|
|
177
172
|
});
|
|
173
|
+
|
|
174
|
+
res.pipe(writeStream);
|
|
178
175
|
}).on('error', error => {
|
|
176
|
+
console.error('Failed to download asset');
|
|
177
|
+
console.error(error);
|
|
179
178
|
reject(error);
|
|
180
179
|
});
|
|
181
180
|
});
|
|
@@ -184,3 +183,4 @@ class Asset {
|
|
|
184
183
|
}
|
|
185
184
|
|
|
186
185
|
module.exports = Asset;
|
|
186
|
+
|