node-red-contrib-typescript 1.0.16 → 1.0.18

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": "node-red-contrib-typescript",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "",
5
5
  "author": "kezziny",
6
6
  "license": "ISC",
@@ -130,14 +130,14 @@
130
130
  nodes
131
131
  .filter(node => node.z === id)
132
132
  .forEach(node => {
133
- imports[`/${this.getName(node)}.ts`] = node.code;
133
+ imports[`/${getName(node)}.ts`] = node.code;
134
134
  });
135
135
  subflowNodes
136
136
  .filter(node => node.z === id)
137
137
  .forEach(node => {
138
138
  let subImports = resolveFlow(node.type.split(":")[1]);
139
139
  for (let key in subImports) {
140
- imports[`/${this.getName(node)}${key}`] = subImports[key];
140
+ imports[`/${getName(node)}${key}`] = subImports[key];
141
141
  }
142
142
  });
143
143
  return imports;
@@ -284,13 +284,11 @@
284
284
  </div>
285
285
 
286
286
  <div class="form-row">
287
+ <label for="node-input-filename"><i class="fa fa-tag"></i> Filename</label>
288
+ <input id="node-input-filename" type="text" value="">
287
289
  <label for="node-input-outputs"><i class="fa fa-random"></i> <span data-i18n="function.label.outputs"></span></label>
288
290
  <input id="node-input-outputs" style="width: 60px;" value="1">
289
291
  </div>
290
- <div class="form-row">
291
- <label for="node-input-filename"><i class="fa fa-tag"></i> Filename <br><sub>(prefix, if ends with '/')</sub></label>
292
- <input id="node-input-filename" type="text" value="">
293
- </div>
294
292
 
295
293
  <div style="height: calc(100% - 68px); min-height:250px;" class="node-text-editor" id="node-input-example-editor"></div>
296
294
  </script>
@@ -2,6 +2,7 @@ let registry = {};
2
2
  module.exports = function(RED) {
3
3
  var helper = require("../../helper.js");
4
4
  var vm = require("vm");
5
+ var nodePath = require("path");
5
6
 
6
7
  function TypescriptInstance(config) {
7
8
  RED.nodes.createNode(this,config);
@@ -86,6 +87,7 @@ module.exports = function(RED) {
86
87
  }
87
88
 
88
89
  if (target.startsWith("/")) {
90
+ target = nodePath.normalize(target);
89
91
  libraryPromises.push(
90
92
  new Promise(async (resolve, reject) => {
91
93
  let dependency = registry[target];
@@ -144,6 +146,7 @@ module.exports = function(RED) {
144
146
  }
145
147
 
146
148
  if (target.startsWith("/")) {
149
+ target = nodePath.normalize(target);
147
150
  return registry[target].exports;
148
151
  }
149
152
  return modules[target];