squishjs 1.0.3 → 1.0.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squishjs",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "squish & unsquish stuff",
5
5
  "scripts": {
6
6
  "test": "node testRunner.js"
package/src/Asset.js CHANGED
@@ -1,8 +1,6 @@
1
1
  const path = require('path');
2
2
  const { getAppDataPath } = require('./utils');
3
3
 
4
- const HG_ASSET_PATH = path.join(getAppDataPath(), 'asset-cache');
5
-
6
4
  class Asset {
7
5
  constructor(info, data = null) {
8
6
  this.info = info;
@@ -72,6 +70,7 @@ class Asset {
72
70
 
73
71
  getFileLocation() {
74
72
  const fileHash = this.getHash(this.info.id);
73
+ const HG_ASSET_PATH = path.join(getAppDataPath(), 'asset-cache');
75
74
  return `${HG_ASSET_PATH}/${fileHash}`;
76
75
  }
77
76
 
@@ -93,6 +92,7 @@ class Asset {
93
92
  }
94
93
 
95
94
  async downloadSync(force) {
95
+ const HG_ASSET_PATH = path.join(getAppDataPath(), 'asset-cache');
96
96
  if (!fs.existsSync(HG_ASSET_PATH)) {
97
97
  fs.mkdirSync(HG_ASSET_PATH);
98
98
  }
@@ -110,6 +110,7 @@ class Asset {
110
110
  }
111
111
 
112
112
  download(force) {
113
+ const HG_ASSET_PATH = path.join(getAppDataPath(), 'asset-cache');
113
114
  if (!this.fs.existsSync(HG_ASSET_PATH)) {
114
115
  this.fs.mkdirSync(HG_ASSET_PATH);
115
116
  }
package/src/Squisher.js CHANGED
@@ -147,21 +147,6 @@ class Squisher {
147
147
  this.squishHelper(node.node.children[i], squishedNodes, scale, playerMap, pathFilter);
148
148
  }
149
149
 
150
- // debug
151
- for (let k in playerMap) {
152
- for (let squished in playerMap[k]) {
153
- const unsquished = unsquish(playerMap[k][squished]);
154
- if (unsquished.node.playerIds.length > 0 && unsquished.node.playerIds.findIndex(i => Number(i) === Number(k)) < 0) {
155
- console.log(unsquished.node.playerIds);
156
- console.log(k);
157
- console.log(unsquished.node.playerIds.indexOf(k));
158
- if (k != 254) {
159
- throw new Error('fuk');
160
- }
161
- }
162
- }
163
- }
164
-
165
150
  }
166
151
 
167
152
  getJson() {