node-red-contrib-typescript 1.0.18 → 1.0.19

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.18",
3
+ "version": "1.0.19",
4
4
  "description": "",
5
5
  "author": "kezziny",
6
6
  "license": "ISC",
@@ -66,25 +66,16 @@ module.exports = function(RED) {
66
66
  if (target.startsWith("/subflow")) {
67
67
  target = path + target.substring(9);
68
68
  }
69
- if (target.startsWith("#")) {
70
- target = "/lib/" + target.substring(1);
71
- }
72
- if (target.startsWith("$/")) {
73
- target = target.substring(1);
74
- }
75
- if (target.startsWith("./")) {
69
+ if (target.startsWith("./") || target.startsWith("../")) {
76
70
  if (node.config.name.indexOf("/") !== -1) {
77
71
  let count = node.config.name.lastIndexOf("/") + 1;
78
72
  let pathSuffix = node.config.name.substring(0, count);
79
- target = path + pathSuffix + target.substring(2);
73
+ target = path + pathSuffix + target;
80
74
  }
81
75
  else {
82
- target = path + target.substring(2);
76
+ target = path + target;
83
77
  }
84
78
  }
85
- if (target.endsWith(".pkg")) {
86
- target = target.substring(0, target.length - 4) + "/index";
87
- }
88
79
 
89
80
  if (target.startsWith("/")) {
90
81
  target = nodePath.normalize(target);
@@ -126,23 +117,15 @@ module.exports = function(RED) {
126
117
  if (target.startsWith("/subflow")) {
127
118
  target = path + target.substring(9);
128
119
  }
129
- if (target.startsWith("#")) {
130
- target = "/lib/" + target.substring(1);
131
- }
132
- if (target.startsWith("$/")) {
133
- target = target.substring(1);
134
- }
135
- if (target.startsWith("./")) {
120
+ if (target.startsWith("./") || target.startsWith("../")) {
136
121
  if (node.config.name.indexOf("/") !== -1) {
137
122
  let count = node.config.name.lastIndexOf("/") + 1;
138
123
  let pathSuffix = node.config.name.substring(0, count);
139
- target = path + pathSuffix + target.substring(2);
124
+ target = path + pathSuffix + target;
140
125
  }
141
126
  else {
142
- target = path + target.substring(2);
143
- } }
144
- if (target.endsWith(".pkg")) {
145
- target = target.substring(0, target.length - 4) + "/index";
127
+ target = path + target;
128
+ }
146
129
  }
147
130
 
148
131
  if (target.startsWith("/")) {