@markuplint/ml-core 3.15.0 → 4.0.0-alpha.10
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/LICENSE +1 -1
- package/lib/configs.browser.js +11 -11
- package/lib/convert-ruleset.d.ts +1 -1
- package/lib/convert-ruleset.js +3 -8
- package/lib/debug.js +9 -14
- package/lib/index.d.ts +13 -23
- package/lib/index.js +12 -29
- package/lib/ml-core.d.ts +5 -5
- package/lib/ml-core.js +94 -76
- package/lib/ml-dom/helper/accname.d.ts +1 -1
- package/lib/ml-dom/helper/accname.js +12 -19
- package/lib/ml-dom/helper/create-node.d.ts +4 -8
- package/lib/ml-dom/helper/create-node.js +38 -17
- package/lib/ml-dom/helper/debug.d.ts +1 -1
- package/lib/ml-dom/helper/debug.js +13 -22
- package/lib/ml-dom/helper/get-indent.d.ts +18 -0
- package/lib/ml-dom/helper/get-indent.js +112 -0
- package/lib/ml-dom/helper/walkers.d.ts +5 -15
- package/lib/ml-dom/helper/walkers.js +3 -8
- package/lib/ml-dom/index.d.ts +9 -9
- package/lib/ml-dom/index.js +1 -5
- package/lib/ml-dom/manipulations/child-node-methods.d.ts +7 -20
- package/lib/ml-dom/manipulations/child-node-methods.js +13 -25
- package/lib/ml-dom/manipulations/get-children.d.ts +3 -5
- package/lib/ml-dom/manipulations/get-children.js +3 -7
- package/lib/ml-dom/node/attr.d.ts +113 -98
- package/lib/ml-dom/node/attr.js +93 -50
- package/lib/ml-dom/node/block.d.ts +35 -39
- package/lib/ml-dom/node/block.js +8 -14
- package/lib/ml-dom/node/character-data.d.ts +55 -62
- package/lib/ml-dom/node/character-data.js +11 -16
- package/lib/ml-dom/node/child-node.d.ts +8 -15
- package/lib/ml-dom/node/child-node.js +1 -5
- package/lib/ml-dom/node/comment.d.ts +14 -17
- package/lib/ml-dom/node/comment.js +2 -6
- package/lib/ml-dom/node/document-fragment.d.ts +22 -25
- package/lib/ml-dom/node/document-fragment.js +4 -9
- package/lib/ml-dom/node/document-type.d.ts +35 -38
- package/lib/ml-dom/node/document-type.js +8 -14
- package/lib/ml-dom/node/document.d.ts +1598 -1614
- package/lib/ml-dom/node/document.js +330 -275
- package/lib/ml-dom/node/dom-token-list.d.ts +27 -27
- package/lib/ml-dom/node/dom-token-list.js +36 -32
- package/lib/ml-dom/node/element-close-tag.d.ts +20 -0
- package/lib/ml-dom/node/element-close-tag.js +39 -0
- package/lib/ml-dom/node/element.d.ts +1957 -1951
- package/lib/ml-dom/node/element.js +364 -348
- package/lib/ml-dom/node/named-node-map.d.ts +40 -45
- package/lib/ml-dom/node/named-node-map.js +10 -18
- package/lib/ml-dom/node/node-list.d.ts +5 -11
- package/lib/ml-dom/node/node-list.js +8 -16
- package/lib/ml-dom/node/node-store.d.ts +6 -11
- package/lib/ml-dom/node/node-store.js +14 -13
- package/lib/ml-dom/node/node.d.ts +480 -500
- package/lib/ml-dom/node/node.js +83 -73
- package/lib/ml-dom/node/parent-node.d.ts +60 -69
- package/lib/ml-dom/node/parent-node.js +32 -29
- package/lib/ml-dom/node/rule-mapper.d.ts +9 -9
- package/lib/ml-dom/node/rule-mapper.js +26 -21
- package/lib/ml-dom/node/text.d.ts +48 -51
- package/lib/ml-dom/node/text.js +8 -13
- package/lib/ml-dom/node/types.d.ts +42 -90
- package/lib/ml-dom/node/types.js +1 -2
- package/lib/ml-dom/node/unexpected-call-error.d.ts +2 -1
- package/lib/ml-dom/node/unexpected-call-error.js +1 -4
- package/lib/ml-dom/token/token.d.ts +45 -45
- package/lib/ml-dom/token/token.js +32 -26
- package/lib/ml-rule/create-rule.d.ts +2 -4
- package/lib/ml-rule/create-rule.js +1 -5
- package/lib/ml-rule/create-test-rule.d.ts +5 -7
- package/lib/ml-rule/create-test-rule.js +3 -7
- package/lib/ml-rule/index.d.ts +3 -3
- package/lib/ml-rule/index.js +3 -6
- package/lib/ml-rule/ml-rule-context.d.ts +49 -57
- package/lib/ml-rule/ml-rule-context.js +11 -11
- package/lib/ml-rule/ml-rule.d.ts +26 -36
- package/lib/ml-rule/ml-rule.js +34 -31
- package/lib/ml-rule/types.d.ts +18 -33
- package/lib/ml-rule/types.js +1 -2
- package/lib/plugin/index.d.ts +2 -2
- package/lib/plugin/index.js +2 -5
- package/lib/plugin/plugin.d.ts +2 -4
- package/lib/plugin/plugin.js +1 -5
- package/lib/plugin/types.d.ts +6 -6
- package/lib/plugin/types.js +1 -2
- package/lib/ruleset/index.d.ts +5 -5
- package/lib/ruleset/index.js +4 -8
- package/lib/test/index.d.ts +11 -21
- package/lib/test/index.js +18 -24
- package/lib/types.d.ts +11 -11
- package/lib/types.js +1 -2
- package/lib/utils/get-location-from-chars.d.ts +4 -9
- package/lib/utils/get-location-from-chars.js +4 -8
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -5
- package/lib/utils/string-splice.js +1 -5
- package/package.json +19 -15
- package/lib/configs.d.ts +0 -2
- package/lib/configs.js +0 -34
- package/lib/ml-dom/helper/getIndent.d.ts +0 -18
- package/lib/ml-dom/helper/getIndent.js +0 -106
- package/test/ml-dom/helper/accname.spec.js +0 -85
- package/test/ml-dom/helper/create-node.spec.js +0 -18
- package/test/ml-dom/index.spec.js +0 -680
- package/test/ml-dom/ml-rule/create-rule.spec.js +0 -108
|
@@ -1,47 +1,42 @@
|
|
|
1
|
-
import type { MLAttr } from './attr';
|
|
1
|
+
import type { MLAttr } from './attr.js';
|
|
2
2
|
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
3
|
-
export declare class MLNamedNodeMap<T extends RuleConfigValue, O extends PlainData = undefined>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* @implements DOM API: `NamedNodeMap`
|
|
42
|
-
*/
|
|
43
|
-
setNamedItemNS(attr: MLAttr<T, O>): MLAttr<T, O> | null;
|
|
3
|
+
export declare class MLNamedNodeMap<T extends RuleConfigValue, O extends PlainData = undefined> extends Array<MLAttr<T, O>> implements NamedNodeMap {
|
|
4
|
+
getNamedItem(qualifiedName: string): MLAttr<T, O> | null;
|
|
5
|
+
/**
|
|
6
|
+
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
7
|
+
*
|
|
8
|
+
* @unsupported
|
|
9
|
+
* @implements DOM API: `NamedNodeMap`
|
|
10
|
+
*/
|
|
11
|
+
getNamedItemNS(namespace: string | null, localName: string): Attr | null;
|
|
12
|
+
item(index: number): MLAttr<T, O> | null;
|
|
13
|
+
/**
|
|
14
|
+
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
15
|
+
*
|
|
16
|
+
* @unsupported
|
|
17
|
+
* @implements DOM API: `NamedNodeMap`
|
|
18
|
+
*/
|
|
19
|
+
removeNamedItem(qualifiedName: string): MLAttr<T, O>;
|
|
20
|
+
/**
|
|
21
|
+
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
22
|
+
*
|
|
23
|
+
* @unsupported
|
|
24
|
+
* @implements DOM API: `NamedNodeMap`
|
|
25
|
+
*/
|
|
26
|
+
removeNamedItemNS(namespace: string | null, localName: string): MLAttr<T, O>;
|
|
27
|
+
/**
|
|
28
|
+
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
29
|
+
*
|
|
30
|
+
* @unsupported
|
|
31
|
+
* @implements DOM API: `NamedNodeMap`
|
|
32
|
+
*/
|
|
33
|
+
setNamedItem(attr: MLAttr<T, O>): MLAttr<T, O> | null;
|
|
34
|
+
/**
|
|
35
|
+
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
36
|
+
*
|
|
37
|
+
* @unsupported
|
|
38
|
+
* @implements DOM API: `NamedNodeMap`
|
|
39
|
+
*/
|
|
40
|
+
setNamedItemNS(attr: MLAttr<T, O>): MLAttr<T, O> | null;
|
|
44
41
|
}
|
|
45
|
-
export declare function toNamedNodeMap<T extends RuleConfigValue, O extends PlainData = undefined>(
|
|
46
|
-
nodes: ReadonlyArray<MLAttr<T, O>>,
|
|
47
|
-
): MLNamedNodeMap<T, O>;
|
|
42
|
+
export declare function toNamedNodeMap<T extends RuleConfigValue, O extends PlainData = undefined>(nodes: ReadonlyArray<MLAttr<T, O>>): MLNamedNodeMap<T, O>;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.toNamedNodeMap = exports.MLNamedNodeMap = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const unexpected_call_error_1 = tslib_1.__importDefault(require("./unexpected-call-error"));
|
|
6
|
-
class MLNamedNodeMap extends Array {
|
|
1
|
+
import { UnexpectedCallError } from './unexpected-call-error.js';
|
|
2
|
+
export class MLNamedNodeMap extends Array {
|
|
7
3
|
getNamedItem(qualifiedName) {
|
|
8
|
-
|
|
9
|
-
return (_a = this.find(attr => attr.name === qualifiedName)) !== null && _a !== void 0 ? _a : null;
|
|
4
|
+
return this.find(attr => attr.name === qualifiedName) ?? null;
|
|
10
5
|
}
|
|
11
6
|
/**
|
|
12
7
|
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
@@ -15,11 +10,10 @@ class MLNamedNodeMap extends Array {
|
|
|
15
10
|
* @implements DOM API: `NamedNodeMap`
|
|
16
11
|
*/
|
|
17
12
|
getNamedItemNS(namespace, localName) {
|
|
18
|
-
throw new
|
|
13
|
+
throw new UnexpectedCallError('Not supported "getNamedItemNS" method');
|
|
19
14
|
}
|
|
20
15
|
item(index) {
|
|
21
|
-
|
|
22
|
-
return (_a = this[index]) !== null && _a !== void 0 ? _a : null;
|
|
16
|
+
return this[index] ?? null;
|
|
23
17
|
}
|
|
24
18
|
/**
|
|
25
19
|
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
@@ -28,7 +22,7 @@ class MLNamedNodeMap extends Array {
|
|
|
28
22
|
* @implements DOM API: `NamedNodeMap`
|
|
29
23
|
*/
|
|
30
24
|
removeNamedItem(qualifiedName) {
|
|
31
|
-
throw new
|
|
25
|
+
throw new UnexpectedCallError('Not supported "removeNamedItem" method');
|
|
32
26
|
}
|
|
33
27
|
/**
|
|
34
28
|
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
@@ -37,7 +31,7 @@ class MLNamedNodeMap extends Array {
|
|
|
37
31
|
* @implements DOM API: `NamedNodeMap`
|
|
38
32
|
*/
|
|
39
33
|
removeNamedItemNS(namespace, localName) {
|
|
40
|
-
throw new
|
|
34
|
+
throw new UnexpectedCallError('Not supported "removeNamedItemNS" method');
|
|
41
35
|
}
|
|
42
36
|
/**
|
|
43
37
|
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
@@ -48,7 +42,7 @@ class MLNamedNodeMap extends Array {
|
|
|
48
42
|
setNamedItem(
|
|
49
43
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
50
44
|
attr) {
|
|
51
|
-
throw new
|
|
45
|
+
throw new UnexpectedCallError('Not supported "setNamedItem" method');
|
|
52
46
|
}
|
|
53
47
|
/**
|
|
54
48
|
* **IT THROWS AN ERROR WHEN CALLING THIS.**
|
|
@@ -59,14 +53,12 @@ class MLNamedNodeMap extends Array {
|
|
|
59
53
|
setNamedItemNS(
|
|
60
54
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
61
55
|
attr) {
|
|
62
|
-
throw new
|
|
56
|
+
throw new UnexpectedCallError('Not supported "setNamedItemNS" method');
|
|
63
57
|
}
|
|
64
58
|
}
|
|
65
|
-
|
|
66
|
-
function toNamedNodeMap(
|
|
59
|
+
export function toNamedNodeMap(
|
|
67
60
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
68
61
|
nodes) {
|
|
69
62
|
const namedNodeMap = new MLNamedNodeMap(...nodes);
|
|
70
63
|
return namedNodeMap;
|
|
71
64
|
}
|
|
72
|
-
exports.toNamedNodeMap = toNamedNodeMap;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type { MLChildNode } from './child-node';
|
|
2
|
-
import type { MLElement } from './element';
|
|
1
|
+
import type { MLChildNode } from './child-node.js';
|
|
2
|
+
import type { MLElement } from './element.js';
|
|
3
3
|
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
4
|
-
export declare function toNodeList<T extends RuleConfigValue, O extends PlainData, N extends MLChildNode<T, O>>(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare function toHTMLCollection<T extends RuleConfigValue, O extends PlainData = undefined>(
|
|
8
|
-
nodes: ReadonlyArray<MLElement<T, O>>,
|
|
9
|
-
): HTMLCollectionOf<MLElement<T, O>>;
|
|
10
|
-
export declare function nodeListToHTMLCollection<T extends RuleConfigValue, O extends PlainData = undefined>(
|
|
11
|
-
nodeList: NodeListOf<MLChildNode<T, O>>,
|
|
12
|
-
): HTMLCollectionOf<MLElement<T, O>>;
|
|
4
|
+
export declare function toNodeList<T extends RuleConfigValue, O extends PlainData, N extends MLChildNode<T, O>>(nodes: ReadonlyArray<N>): NodeListOf<N>;
|
|
5
|
+
export declare function toHTMLCollection<T extends RuleConfigValue, O extends PlainData = undefined>(nodes: ReadonlyArray<MLElement<T, O>>): HTMLCollectionOf<MLElement<T, O>>;
|
|
6
|
+
export declare function nodeListToHTMLCollection<T extends RuleConfigValue, O extends PlainData = undefined>(nodeList: NodeListOf<MLChildNode<T, O>>): HTMLCollectionOf<MLElement<T, O>>;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nodeListToHTMLCollection = exports.toHTMLCollection = exports.toNodeList = void 0;
|
|
4
1
|
class MLNodeList extends Array {
|
|
5
2
|
forEach(callbackfn, thisArg) {
|
|
6
|
-
return super.forEach.bind(this)((v, k) => callbackfn(v, k, thisArg
|
|
3
|
+
return super.forEach.bind(this)((v, k) => callbackfn(v, k, thisArg ?? this));
|
|
7
4
|
}
|
|
8
5
|
item(index) {
|
|
9
6
|
const node = this[index];
|
|
@@ -23,37 +20,32 @@ class MLNodeList extends Array {
|
|
|
23
20
|
return node;
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
function toNodeList(nodes) {
|
|
23
|
+
export function toNodeList(nodes) {
|
|
27
24
|
const nodeList = new MLNodeList(...nodes);
|
|
28
25
|
return nodeList;
|
|
29
26
|
}
|
|
30
|
-
exports.toNodeList = toNodeList;
|
|
31
27
|
class MLHTMLCollection extends Array {
|
|
32
28
|
item(index) {
|
|
33
|
-
|
|
34
|
-
return (_a = this[index]) !== null && _a !== void 0 ? _a : null;
|
|
29
|
+
return this[index] ?? null;
|
|
35
30
|
}
|
|
36
31
|
namedItem(name) {
|
|
37
|
-
|
|
38
|
-
return (_a = this.find(el => el.getAttribute('name') === name)) !== null && _a !== void 0 ? _a : null;
|
|
32
|
+
return this.find(el => el.getAttribute('name') === name) ?? null;
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
|
-
function toHTMLCollection(
|
|
35
|
+
export function toHTMLCollection(
|
|
42
36
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
43
37
|
nodes) {
|
|
44
38
|
const collection = new MLHTMLCollection(...nodes);
|
|
45
39
|
return collection;
|
|
46
40
|
}
|
|
47
|
-
|
|
48
|
-
function nodeListToHTMLCollection(
|
|
41
|
+
export function nodeListToHTMLCollection(
|
|
49
42
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
50
43
|
nodeList) {
|
|
51
44
|
const collection = new MLHTMLCollection();
|
|
52
|
-
|
|
45
|
+
for (const node of nodeList) {
|
|
53
46
|
if (node.is(node.ELEMENT_NODE)) {
|
|
54
47
|
collection.push(node);
|
|
55
48
|
}
|
|
56
|
-
}
|
|
49
|
+
}
|
|
57
50
|
return collection;
|
|
58
51
|
}
|
|
59
|
-
exports.nodeListToHTMLCollection = nodeListToHTMLCollection;
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import type { MLNode } from './node';
|
|
2
|
-
import type { MappedNode } from './types';
|
|
3
|
-
import type {
|
|
1
|
+
import type { MLNode } from './node.js';
|
|
2
|
+
import type { MappedNode } from './types.js';
|
|
3
|
+
import type { MLASTNode } from '@markuplint/ml-ast';
|
|
4
4
|
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
5
5
|
declare class NodeStore {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
): MappedNode<N, T, O>;
|
|
10
|
-
setNode<A extends MLASTAbstractNode, T extends RuleConfigValue, O extends PlainData = undefined>(
|
|
11
|
-
astNode: A,
|
|
12
|
-
node: MLNode<T, O, A>,
|
|
13
|
-
): void;
|
|
6
|
+
#private;
|
|
7
|
+
getNode<N extends MLASTNode, T extends RuleConfigValue, O extends PlainData = undefined>(astNode: N): MappedNode<N, T, O>;
|
|
8
|
+
setNode<A extends MLASTNode, T extends RuleConfigValue, O extends PlainData = undefined>(astNode: A, node: MLNode<T, O, A>): void;
|
|
14
9
|
}
|
|
15
10
|
/**
|
|
16
11
|
* `NodeStore` Singleton
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
2
6
|
var _NodeStore_store;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const parser_utils_1 = require("@markuplint/parser-utils");
|
|
7
|
-
const debug_1 = require("../../debug");
|
|
8
|
-
const nodeStoreLog = debug_1.log.extend('node-store');
|
|
7
|
+
import { TargetParserError } from '@markuplint/parser-utils';
|
|
8
|
+
import { log } from '../../debug.js';
|
|
9
|
+
const nodeStoreLog = log.extend('node-store');
|
|
9
10
|
const nodeStoreError = nodeStoreLog.extend('error');
|
|
10
11
|
class NodeStore {
|
|
11
12
|
constructor() {
|
|
@@ -13,14 +14,14 @@ class NodeStore {
|
|
|
13
14
|
}
|
|
14
15
|
getNode(astNode) {
|
|
15
16
|
// console.log(`Get: ${astNode.uuid} -> ${astNode.raw.trim()}(${astNode.type})`);
|
|
16
|
-
const node =
|
|
17
|
+
const node = __classPrivateFieldGet(this, _NodeStore_store, "f").get(astNode.uuid);
|
|
17
18
|
if (!node) {
|
|
18
19
|
nodeStoreError('Ref ID: %s (%s: "%s")', astNode.uuid, astNode.nodeName, astNode.raw);
|
|
19
|
-
nodeStoreError('Map: %O',
|
|
20
|
+
nodeStoreError('Map: %O', [...__classPrivateFieldGet(this, _NodeStore_store, "f").entries()].map(([id, node]) => ({
|
|
20
21
|
id,
|
|
21
22
|
name: node.nodeName,
|
|
22
23
|
})));
|
|
23
|
-
throw new
|
|
24
|
+
throw new TargetParserError('Broke mapping nodes.', {
|
|
24
25
|
line: astNode.startLine,
|
|
25
26
|
col: astNode.startCol,
|
|
26
27
|
raw: astNode.raw,
|
|
@@ -39,12 +40,12 @@ class NodeStore {
|
|
|
39
40
|
nodeStoreError('UUID is invalid: %s (%s: "%s")', astNode.uuid, astNode.nodeName, astNode.raw);
|
|
40
41
|
nodeStoreError('Invalid node: %O', node);
|
|
41
42
|
}
|
|
42
|
-
nodeStoreLog('Mapped: %s (%s: "%s")', astNode.uuid, astNode.nodeName, astNode.raw.
|
|
43
|
-
|
|
43
|
+
nodeStoreLog('Mapped: %s (%s: "%s")', astNode.uuid, astNode.nodeName, astNode.raw.replaceAll('\n', '⏎').replaceAll('\t', '→'));
|
|
44
|
+
__classPrivateFieldGet(this, _NodeStore_store, "f").set(astNode.uuid, node);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
_NodeStore_store = new WeakMap();
|
|
47
48
|
/**
|
|
48
49
|
* `NodeStore` Singleton
|
|
49
50
|
*/
|
|
50
|
-
|
|
51
|
+
export const nodeStore = new NodeStore();
|