telos-server 1.0.3 → 1.0.5

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,12 +1,13 @@
1
1
  {
2
2
  "name": "telos-server",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "An Extensible CMS Server for Telos Origin.",
5
5
  "main": "telosServer.json",
6
6
  "dependencies": {
7
7
  "apint": "~1.0.0",
8
8
  "bus-net": "~1.0.0",
9
- "telos-use-js": "~1.0.0"
9
+ "telos-use-js": "~1.0.0",
10
+ "universal-preprocessor": "~1.0.0"
10
11
  },
11
12
  "author": "",
12
13
  "license": "Apache-2.0",
package/serverUtils.js CHANGED
@@ -36,8 +36,8 @@ function getArgOptions(args) {
36
36
 
37
37
  args.forEach((item, index) => {
38
38
 
39
- if(item.startsWith("-") && index < packet.content.length - 1)
40
- options[item.substring(1)] = packet.content[index + 1];
39
+ if(item.startsWith("-") && index < args.length - 1)
40
+ options[item.substring(1)] = args[index + 1];
41
41
  });
42
42
 
43
43
  return options;
@@ -1,5 +1,7 @@
1
1
  var fs = use("fs");
2
2
  var path = use("path");
3
+ var pup = require("universal-preprocessor");
4
+ var pupLangs = require("universal-preprocessor/pupLangs");
3
5
 
4
6
  let extensionTypes = {
5
7
  'txt': 'text/plain',
@@ -156,8 +158,10 @@ function middlewareText(packet, file) {
156
158
  }
157
159
  }
158
160
 
159
- function preprocess(string) {
160
- return string;
161
+ function preprocess(string, file) {
162
+
163
+ return (file != null ? file.meta.pup != null : true) ?
164
+ pup.preprocess(pupLangs, string) : string;
161
165
  }
162
166
 
163
167
  module.exports = {