@jam-comments/server-utilities 5.8.2 → 5.8.3

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/store.js CHANGED
@@ -1,27 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- let STORE = null;
3
+ globalThis.jamCommentsStore = null;
4
4
  const store = {
5
5
  init() {
6
- STORE = new Map();
6
+ globalThis.jamCommentsStore = new Map();
7
7
  },
8
8
  isInitialized() {
9
- return STORE !== null;
9
+ return globalThis.jamCommentsStore !== null;
10
10
  },
11
11
  set(path, markup) {
12
- STORE.set(store.toPathKey(path), markup);
12
+ globalThis.jamCommentsStore.set(store.toPathKey(path), markup);
13
13
  },
14
14
  get(path) {
15
- return STORE.get(store.toPathKey(path)) || null;
15
+ return globalThis.jamCommentsStore.get(store.toPathKey(path)) || null;
16
16
  },
17
17
  clear() {
18
- if (STORE) {
19
- STORE.clear();
20
- STORE = null;
18
+ if (globalThis.jamCommentsStore) {
19
+ globalThis.jamCommentsStore.clear();
20
+ globalThis.jamCommentsStore = null;
21
21
  }
22
22
  },
23
23
  getEmptyMarkup() {
24
- return STORE.get("EMPTY");
24
+ return globalThis.jamCommentsStore.get("EMPTY");
25
25
  },
26
26
  toPathKey(path) {
27
27
  return path.replace(/^\//, "").replace(/\//g, "::");
package/dist/esm/store.js CHANGED
@@ -1,25 +1,25 @@
1
- let STORE = null;
1
+ globalThis.jamCommentsStore = null;
2
2
  const store = {
3
3
  init() {
4
- STORE = new Map();
4
+ globalThis.jamCommentsStore = new Map();
5
5
  },
6
6
  isInitialized() {
7
- return STORE !== null;
7
+ return globalThis.jamCommentsStore !== null;
8
8
  },
9
9
  set(path, markup) {
10
- STORE.set(store.toPathKey(path), markup);
10
+ globalThis.jamCommentsStore.set(store.toPathKey(path), markup);
11
11
  },
12
12
  get(path) {
13
- return STORE.get(store.toPathKey(path)) || null;
13
+ return globalThis.jamCommentsStore.get(store.toPathKey(path)) || null;
14
14
  },
15
15
  clear() {
16
- if (STORE) {
17
- STORE.clear();
18
- STORE = null;
16
+ if (globalThis.jamCommentsStore) {
17
+ globalThis.jamCommentsStore.clear();
18
+ globalThis.jamCommentsStore = null;
19
19
  }
20
20
  },
21
21
  getEmptyMarkup() {
22
- return STORE.get("EMPTY");
22
+ return globalThis.jamCommentsStore.get("EMPTY");
23
23
  },
24
24
  toPathKey(path) {
25
25
  return path.replace(/^\//, "").replace(/\//g, "::");
@@ -2,9 +2,9 @@ declare const store: {
2
2
  init(): void;
3
3
  isInitialized(): boolean;
4
4
  set(path: string, markup: string): void;
5
- get(path: string): string;
5
+ get(path: string): any;
6
6
  clear(): void;
7
- getEmptyMarkup(): string;
7
+ getEmptyMarkup(): any;
8
8
  toPathKey(path: string): string;
9
9
  };
10
10
  export default store;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jam-comments/server-utilities",
3
- "version": "5.8.2",
3
+ "version": "5.8.3",
4
4
  "description": "Various JavaScript utilities for JamComments.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",