catto.js 0.8.2 → 0.8.4

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/Server.js CHANGED
@@ -38,7 +38,8 @@ class Server extends EventEmitter {
38
38
  "cjs": !1,
39
39
  "proxies": 0,
40
40
  "bodyCompatible": !1,
41
- "secureCookie": !0
41
+ "secureCookie": !0,
42
+ "cookieAge": 31536e6
42
43
  }, options || {});
43
44
  this.app = express();
44
45
  if (this.options.ssl) {
@@ -70,7 +71,8 @@ class Server extends EventEmitter {
70
71
  "store": new FileStore(this.options.storeOptions),
71
72
  "secret": this.options.secret,
72
73
  "cookie": {
73
- "secure": this.options.secureCookie
74
+ "secure": this.options.secureCookie,
75
+ "maxAge": this.options.cookieAge
74
76
  },
75
77
  "resave": !0,
76
78
  "saveUninitialized": !0
@@ -166,7 +168,7 @@ class Server extends EventEmitter {
166
168
  code = code.replace(/^<!DOCTYPE html>(\r?\n)?/, "");
167
169
  }
168
170
  var parts = code.split(/<%s(?:erver)?(?!\*)(?!=) +(.+?) +%>/g);
169
- var compile = `var __output = "${doctype ? "<!DOCTYPE html>\\n" : ""}<script src=\\"/_cattojs/cjs_client.js\\"></script>\\n";\nfunction __escape(str) {\n if (typeof str !== "string") {\n str = str.toString();\n }\n return str.split("<").join("&lt;").split(">").join("&gt;");\n}\n`;
171
+ var compile = `var __output = "${doctype ? "<!DOCTYPE html>\\n" : ""}<script src=\\"/_cattojs/cjs_client.js\\"></script>\\n";\nfunction __escape(str) {\n if (str === void 0) {\n return "undefined";\n }\n if (typeof str !== "string") {\n str = str.toString();\n }\n return str.split("<").join("&lt;").split(">").join("&gt;");\n}\n`;
170
172
  parts.forEach((part, index) => {
171
173
  compile += ((index + 1) % 2 < 1 ? `${part}\n` : `__output += ${JSON.stringify(part)}.replace(/<%s(?:erver)?(?!\\*)= +(.+?) +%>/g, (_, g) => __escape(eval(g))).replace(/<%s(?:erver)?(?!\\*)- +(.+?) +%>/g, (_, g) => eval(g)).replace(/<%s(erver)\\*?# +(.+?) +%>/g, "");\n`);
172
174
  });
package/cjs_client.js CHANGED
@@ -14,6 +14,9 @@
14
14
  compile += ((index + 1) % 2 < 1 ? `${part}\n` : `output += ${JSON.stringify(part)}.replace(/<%c(?:lient)?(\\*)?= +(.+?) +%>/g, (_, t, g) => __rpf(t, g, eval(g), !0)).replace(/<%c(?:lient)?(\\*)?- +(.+?) +%>/g, (_, t, g) => __rpf(t, g, eval(g), !1)).replace(/<%c(lient)\\*?# +(.+?) +%>/g, "");\n`);
15
15
  });
16
16
  window.__rpf = (t, g, result, r) => {
17
+ if (result === void 0) {
18
+ return "undefined";
19
+ }
17
20
  if (typeof result !== "string") {
18
21
  result = result.toString();
19
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catto.js",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "Universal module for everything.",
5
5
  "main": "index.js",
6
6
  "scripts": {