catto.js 0.8.9 → 0.9.0

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.
Files changed (2) hide show
  1. package/cjs_client.js +10 -3
  2. package/package.json +1 -1
package/cjs_client.js CHANGED
@@ -3,7 +3,8 @@
3
3
  // catto.js
4
4
 
5
5
  (() => {
6
- var symbol = "%";
6
+ var symbol = window._CATTOJS_SYMBOL || "%";
7
+ var updateTime = window._CATTOJS_UPDATE_TIME || 1;
7
8
 
8
9
  var incid = 0;
9
10
  var cache = {};
@@ -64,6 +65,12 @@
64
65
  if (!ignoret && t) {
65
66
  function update(id, code, format) {
66
67
  var result2 = eval(code);
68
+ if (result2 === void 0) {
69
+ return "undefined";
70
+ }
71
+ if (typeof result2 !== "string") {
72
+ result2 = result2.toString();
73
+ }
67
74
  if (format) {
68
75
  result2 = result2.split("<").join("&lt;").split(">").join("&gt;");
69
76
  }
@@ -76,7 +83,7 @@
76
83
  }
77
84
  }
78
85
  }
79
- setInterval(update.bind(null, ++incid, g, r), 1);
86
+ setInterval(update.bind(null, ++incid, g, r), updateTime);
80
87
  return `<span id="_cattojs_d${incid}">${result}</span>`;
81
88
  }
82
89
  return result;
@@ -92,7 +99,7 @@
92
99
  }
93
100
  }
94
101
  if (Object.keys(cfs).length) {
95
- setInterval(() => Object.entries(cfs).forEach(updateb), 1);
102
+ setInterval(() => Object.entries(cfs).forEach(updateb), updateTime);
96
103
  }
97
104
  return output;
98
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catto.js",
3
- "version": "0.8.9",
3
+ "version": "0.9.0",
4
4
  "description": "Universal module for everything.",
5
5
  "main": "index.js",
6
6
  "scripts": {