squishjs 1.0.11 → 1.1.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Asset.js +2 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squishjs",
3
- "version": "1.0.11",
3
+ "version": "1.1.0",
4
4
  "description": "squish & unsquish stuff",
5
5
  "scripts": {
6
6
  "test": "node testRunner.js"
package/src/Asset.js CHANGED
@@ -157,17 +157,14 @@ class Asset {
157
157
  const filePath = `${path}/${fileHash}`;
158
158
 
159
159
  const writeStream = this.fs.createWriteStream(filePath);
160
+ const getModule = this.https;
160
161
 
161
162
  writeStream.on('close', () => {
162
163
  resolve(filePath);
163
164
  });
164
165
 
165
166
  let data = '';
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) => {
167
+ getModule.get(`https://assets.homegames.io/${assetId}`, (res) => {
171
168
  res.on('data', (chunk) => {
172
169
  data += chunk;
173
170
  writeStream.write(chunk);