@jam-comments/server-utilities 5.8.3 → 5.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.
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/store.js +11 -9
- package/dist/esm/index.js +2 -0
- package/dist/esm/store.js +11 -9
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logError = exports.log = exports.removeFalseyValues = exports.fetchAll = exports.markupFetcher = void 0;
|
|
6
|
+
exports.store = exports.logError = exports.log = exports.removeFalseyValues = exports.fetchAll = exports.markupFetcher = void 0;
|
|
7
|
+
const store_1 = __importDefault(require("./store"));
|
|
8
|
+
exports.store = store_1.default;
|
|
4
9
|
var markupFetcher_1 = require("./markupFetcher");
|
|
5
10
|
Object.defineProperty(exports, "markupFetcher", { enumerable: true, get: function () { return markupFetcher_1.markupFetcher; } });
|
|
6
11
|
Object.defineProperty(exports, "fetchAll", { enumerable: true, get: function () { return markupFetcher_1.fetchAll; } });
|
package/dist/cjs/store.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
let STORE = null;
|
|
4
4
|
const store = {
|
|
5
5
|
init() {
|
|
6
|
-
|
|
6
|
+
if (!STORE) {
|
|
7
|
+
STORE = new Map();
|
|
8
|
+
}
|
|
7
9
|
},
|
|
8
10
|
isInitialized() {
|
|
9
|
-
return
|
|
11
|
+
return STORE !== null;
|
|
10
12
|
},
|
|
11
13
|
set(path, markup) {
|
|
12
|
-
|
|
14
|
+
STORE.set(store.toPathKey(path), markup);
|
|
13
15
|
},
|
|
14
16
|
get(path) {
|
|
15
|
-
return
|
|
17
|
+
return STORE.get(store.toPathKey(path)) || null;
|
|
16
18
|
},
|
|
17
19
|
clear() {
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
if (STORE) {
|
|
21
|
+
STORE.clear();
|
|
22
|
+
STORE = null;
|
|
21
23
|
}
|
|
22
24
|
},
|
|
23
25
|
getEmptyMarkup() {
|
|
24
|
-
return
|
|
26
|
+
return STORE.get("EMPTY");
|
|
25
27
|
},
|
|
26
28
|
toPathKey(path) {
|
|
27
29
|
return path.replace(/^\//, "").replace(/\//g, "::");
|
package/dist/esm/index.js
CHANGED
package/dist/esm/store.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
let STORE = null;
|
|
2
2
|
const store = {
|
|
3
3
|
init() {
|
|
4
|
-
|
|
4
|
+
if (!STORE) {
|
|
5
|
+
STORE = new Map();
|
|
6
|
+
}
|
|
5
7
|
},
|
|
6
8
|
isInitialized() {
|
|
7
|
-
return
|
|
9
|
+
return STORE !== null;
|
|
8
10
|
},
|
|
9
11
|
set(path, markup) {
|
|
10
|
-
|
|
12
|
+
STORE.set(store.toPathKey(path), markup);
|
|
11
13
|
},
|
|
12
14
|
get(path) {
|
|
13
|
-
return
|
|
15
|
+
return STORE.get(store.toPathKey(path)) || null;
|
|
14
16
|
},
|
|
15
17
|
clear() {
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
if (STORE) {
|
|
19
|
+
STORE.clear();
|
|
20
|
+
STORE = null;
|
|
19
21
|
}
|
|
20
22
|
},
|
|
21
23
|
getEmptyMarkup() {
|
|
22
|
-
return
|
|
24
|
+
return STORE.get("EMPTY");
|
|
23
25
|
},
|
|
24
26
|
toPathKey(path) {
|
|
25
27
|
return path.replace(/^\//, "").replace(/\//g, "::");
|
package/dist/types/index.d.ts
CHANGED