paralayer 1.0.3 → 1.0.4

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/dist/paralayer.js +3 -10
  2. package/package.json +1 -1
package/dist/paralayer.js CHANGED
@@ -190,7 +190,6 @@ export class Paralayer extends $utils.Unit {
190
190
  return [...imports].join('\n');
191
191
  }
192
192
  generateSetupContent(allLayers) {
193
- const nocheck = '// @ts-nocheck';
194
193
  const layers = allLayers.toSorted((layer1, layer2) => {
195
194
  if (layer1.length !== layer2.length)
196
195
  return layer1.length - layer2.length;
@@ -198,17 +197,11 @@ export class Paralayer extends $utils.Unit {
198
197
  });
199
198
  const vars = layers.map(layer => {
200
199
  const $layerName = this.getLayerName(layer, '$camel');
200
+ if (this.options.globalize)
201
+ return `globalThis.${$layerName} = {}`;
201
202
  return `const ${$layerName} = {}`;
202
203
  });
203
- let globals = [];
204
- if (this.options.globalize) {
205
- globals = layers.map(layer => {
206
- const $layerName = this.getLayerName(layer, '$camel');
207
- return `globalThis.${$layerName} = ${$layerName}`;
208
- });
209
- globals.unshift('');
210
- }
211
- return [nocheck, '', ...vars, ...globals, ''].join('\n');
204
+ return [...vars].join('\n');
212
205
  }
213
206
  getLayer(path) {
214
207
  const name = $path.basename(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paralayer",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "imkost",