node-red-contrib-typescript 1.0.10 → 1.0.12

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/helper.js CHANGED
@@ -212,6 +212,7 @@ function createSandbox(RED, node) {
212
212
  return sandbox;
213
213
  }
214
214
 
215
+ global.WebSocket = require("ws");
215
216
  function createScript(node, iniOpt, code) {
216
217
  //console.log(ts.transpile(code));
217
218
  var iniText = `
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "node-red-contrib-typescript",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "",
5
5
  "author": "kezziny",
6
6
  "license": "ISC",
7
- "node-red" : {
7
+ "node-red": {
8
8
  "nodes": {
9
9
  "instance": "src/instance/instance.js"
10
10
  }
11
- }
11
+ },
12
+ "dependencies": {
13
+ "ws": "^8.19.0"
14
+ }
12
15
  }
@@ -197,6 +197,7 @@
197
197
  color: '#3178c6',
198
198
  defaults: {
199
199
  name: {value:""},
200
+ filename: {value:""},
200
201
  outputs:{value:1},
201
202
  code: {value:""},
202
203
  },
@@ -266,6 +267,8 @@
266
267
  <div class="form-row">
267
268
  <label for="node-input-outputs"><i class="fa fa-random"></i> <span data-i18n="function.label.outputs"></span></label>
268
269
  <input id="node-input-outputs" style="width: 60px;" value="1">
270
+ <label for="node-input-filename"><i class="fa fa-random"></i> Override filename</label>
271
+ <input id="node-input-filename" style="width: 60px;" value="">
269
272
  </div>
270
273
 
271
274
  <div style="height: calc(100% - 68px); min-height:250px;" class="node-text-editor" id="node-input-example-editor"></div>
@@ -85,9 +85,10 @@ module.exports = function(RED) {
85
85
  dependency = registry[target];
86
86
  await new Promise(r => setTimeout(r, 50));
87
87
  }
88
- if (dependency === null || dependency === undefined) reject(new Error("Dependency not found: " + target));
89
- else {
88
+ try {
90
89
  dependency.loading.then(() => resolve(dependency)).catch(error => reject(error));
90
+ } catch (e) {
91
+ reject(new Error("Dependency not found: " + target));
91
92
  }
92
93
  })
93
94
  );