@lmjs/cli 1.0.18 → 1.0.20

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/lib/app.js CHANGED
@@ -72,7 +72,7 @@ wss.on('connection', (ws) => {
72
72
  data: __data ?? {},
73
73
  headers: _body['headers'] ?? config.apis[_body['api'] ?? 0].headers
74
74
  });
75
- _data.payload = res.data;
75
+ _data.payload = (_body['full']) ? res : res.data;
76
76
  ws.send(JSON.stringify(_data));
77
77
 
78
78
  } catch (e) {
@@ -89,8 +89,6 @@ wss.on('connection', (ws) => {
89
89
 
90
90
  }
91
91
  });
92
-
93
- ws.send('Hi there, I am a WebSocket server');
94
92
  });
95
93
 
96
94
  global.app = app;
package/lib/fcs.js CHANGED
@@ -179,7 +179,7 @@ function copyDir(src, dest, projectName) {
179
179
  const entries = fs.readdirSync(src, { encoding: 'utf8', withFileTypes: true });
180
180
 
181
181
  cd(dest);
182
-
182
+
183
183
  for (let entry of entries) {
184
184
  const srcPath = path.join(src.toString(), entry.name.toString());
185
185
  const destPath = path.join(dest.toString(), entry.name.toString());
@@ -212,16 +212,16 @@ function copyDir(src, dest, projectName) {
212
212
  }
213
213
  exports.copyDir = copyDir;
214
214
 
215
-
216
- function validURL(str) {
217
- var pattern = new RegExp('^(https?:\\/\\/)?' +
218
- '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' +
219
- '((\\d{1,3}\\.){3}\\d{1,3}))' +
220
- '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' +
221
- '(\\?[;&a-z\\d%_.~+=-]*)?' +
222
- '(\\#[-a-z\\d_]*)?$', 'i');
223
- return !!pattern.test(str);
215
+ function validURL(string) {
216
+ let url;
217
+ try {
218
+ url = new URL(string);
219
+ } catch (_) {
220
+ return false;
221
+ }
222
+ return url.protocol === "http:" || url.protocol === "https:";
224
223
  }
224
+
225
225
  exports.validURL = validURL;
226
226
 
227
227
  var API =
@@ -7,8 +7,8 @@
7
7
 
8
8
  <settings>
9
9
  {
10
- hasFooter: true,
11
- hasHeader: true,
12
- hasNav: true
10
+ hasFooter: true,
11
+ hasHeader: true,
12
+ hasNav: true
13
13
  }
14
14
  </settings>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmjs/cli",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "LumenJS is a tiny robust reactive javascript framework for building scalable and high-performant web applications and web user interfaces, be it simple or complex, with standard HTML, CSS and JavaScript",
5
5
  "main": "./index.js",
6
6
  "bin": {