@ac-kit/model-markup 0.1.3 → 0.2.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/CHANGELOG.md +26 -0
- package/README.md +28 -0
- package/dist/dom/index.d.ts +77 -0
- package/dist/dom/index.d.ts.map +1 -0
- package/dist/dom/index.js +115 -0
- package/dist/dom/index.js.map +1 -0
- package/package.json +10 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @ac-kit/model-markup
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5c203e7: New `./dom` subpath: `domMarkupShape` reads a W3C DOM (a browser page, a
|
|
8
|
+
`DOMParser` result, jsdom) as a `MarkupTreeShape`, through the standard node
|
|
9
|
+
members only and without reading any global. The document mode is the owner
|
|
10
|
+
document's (`"xml"` unless `text/html`, `"html-quirks"` in `BackCompat`), a
|
|
11
|
+
CDATA section is text, template content and shadow trees stay out of the
|
|
12
|
+
children, and namespaces in scope come from declaration attributes. Its
|
|
13
|
+
structural types (`DomNodeLike`, `DomElementLike`, `DomAttrLike`, …) accept
|
|
14
|
+
the DOM's own.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [5c203e7]
|
|
19
|
+
- Updated dependencies [5c203e7]
|
|
20
|
+
- Updated dependencies [5c203e7]
|
|
21
|
+
- Updated dependencies [5c203e7]
|
|
22
|
+
- Updated dependencies [5c203e7]
|
|
23
|
+
- Updated dependencies [5c203e7]
|
|
24
|
+
- Updated dependencies [5c203e7]
|
|
25
|
+
- @ac-kit/algo@0.7.0
|
|
26
|
+
- @ac-kit/core@0.14.0
|
|
27
|
+
- @ac-kit/math-random@0.4.2
|
|
28
|
+
|
|
3
29
|
## 0.1.3
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -48,6 +48,34 @@ declarations the parser placed on SVG and MathML elements (`xmlns`,
|
|
|
48
48
|
`xmlns:xlink`), inherited and shadowed down the tree, plus the implicit `xml`
|
|
49
49
|
binding; it walks the ancestors on each call.
|
|
50
50
|
|
|
51
|
+
## Reading a DOM
|
|
52
|
+
|
|
53
|
+
The `./dom` subpath reads a W3C DOM — a live page in a browser or an extension,
|
|
54
|
+
or jsdom — through the standard `Node`, `Element` and `Attr` members only. It
|
|
55
|
+
reads no global, so it works on a document from another realm (an iframe, a
|
|
56
|
+
`DOMParser` result, a jsdom window).
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { markupAttributeValue } from "@ac-kit/model-markup";
|
|
60
|
+
import { domMarkupShape } from "@ac-kit/model-markup/dom";
|
|
61
|
+
|
|
62
|
+
const shape = domMarkupShape;
|
|
63
|
+
const paragraph = document.querySelector("p")!;
|
|
64
|
+
|
|
65
|
+
shape.localNameOf(paragraph); // "p"
|
|
66
|
+
markupAttributeValue(shape, paragraph, "id"); // the id, or null
|
|
67
|
+
shape.documentModeOf(paragraph); // "html", "html-quirks" or "xml"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The document mode comes from the owner document: `"xml"` unless its
|
|
71
|
+
`contentType` is `text/html` (XHTML is XML), `"html-quirks"` when its
|
|
72
|
+
`compatMode` is `BackCompat`. Names, namespaces and prefixes are the DOM's own;
|
|
73
|
+
a CDATA section is text, and neither a template's content nor a shadow tree is
|
|
74
|
+
among the children — pass the content fragment or the shadow root to read one.
|
|
75
|
+
`namespacesInScopeOf` reads declaration attributes, as for parse5, so an
|
|
76
|
+
element built with `createElementNS` and no `xmlns` attribute brings no binding
|
|
77
|
+
of its own. The tree is read live; index it to read a snapshot many times.
|
|
78
|
+
|
|
51
79
|
## Indexing a tree read many times
|
|
52
80
|
|
|
53
81
|
parse5 stores no sibling positions, no document order and no id table, and a
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { MarkupTreeShape } from "../markup-tree-shape.js";
|
|
2
|
+
/**
|
|
3
|
+
* A W3C DOM `Node`, declared structurally so this package reads no global and
|
|
4
|
+
* depends on no DOM implementation: a browser's nodes and jsdom's are
|
|
5
|
+
* assignable to it. `nodeType` tells the kinds apart, with the DOM's values.
|
|
6
|
+
*/
|
|
7
|
+
export type DomNodeLike = {
|
|
8
|
+
readonly nodeType: number;
|
|
9
|
+
readonly parentNode: DomNodeLike | null;
|
|
10
|
+
readonly childNodes: ArrayLike<DomNodeLike>;
|
|
11
|
+
/** `null` for a document only. */
|
|
12
|
+
readonly ownerDocument: DomDocumentLike | null;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A DOM `Document`: `contentType` is `"text/html"` for an HTML document, and
|
|
16
|
+
* `compatMode` is `"BackCompat"` in quirks mode.
|
|
17
|
+
*/
|
|
18
|
+
export type DomDocumentLike = DomNodeLike & {
|
|
19
|
+
readonly contentType: string;
|
|
20
|
+
readonly compatMode: string;
|
|
21
|
+
};
|
|
22
|
+
/** A DOM `Element`. */
|
|
23
|
+
export type DomElementLike = DomNodeLike & {
|
|
24
|
+
readonly localName: string;
|
|
25
|
+
readonly namespaceURI: string | null;
|
|
26
|
+
readonly prefix: string | null;
|
|
27
|
+
readonly attributes: ArrayLike<DomAttrLike>;
|
|
28
|
+
};
|
|
29
|
+
/** A DOM `Attr`. */
|
|
30
|
+
export type DomAttrLike = {
|
|
31
|
+
readonly localName: string;
|
|
32
|
+
readonly namespaceURI: string | null;
|
|
33
|
+
readonly prefix: string | null;
|
|
34
|
+
readonly value: string;
|
|
35
|
+
};
|
|
36
|
+
/** A DOM `CharacterData`: a `Text`, `CDATASection` or `Comment`. */
|
|
37
|
+
export type DomCharacterDataLike = DomNodeLike & {
|
|
38
|
+
readonly data: string;
|
|
39
|
+
};
|
|
40
|
+
/** A DOM `ProcessingInstruction`. */
|
|
41
|
+
export type DomProcessingInstructionLike = DomCharacterDataLike & {
|
|
42
|
+
readonly target: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* A {@link MarkupTreeShape} over a W3C DOM — a browser's, or jsdom's — read
|
|
46
|
+
* through the standard `Node`, `Element`, `Attr`, `CharacterData` and
|
|
47
|
+
* `ProcessingInstruction` members only, so it reads no global and works in any
|
|
48
|
+
* realm.
|
|
49
|
+
*
|
|
50
|
+
* - The document mode is the owner document's: `"xml"` unless its `contentType`
|
|
51
|
+
* is `"text/html"` (an XHTML document is XML), and `"html-quirks"` when its
|
|
52
|
+
* `compatMode` is `"BackCompat"`. A detached node keeps its owner document,
|
|
53
|
+
* so the mode is uniform over every tree and answered in O(1).
|
|
54
|
+
* - Names, namespaces and prefixes are the DOM's own, already `null` for none:
|
|
55
|
+
* the HTML parser's elements carry no prefix, and its `xmlns` and
|
|
56
|
+
* `xmlns:xlink` on foreign elements are in `XMLNS_NAMESPACE`, as an XML
|
|
57
|
+
* parser's declarations are.
|
|
58
|
+
* - A CDATA section is `"text"`. A template's content is not among its children;
|
|
59
|
+
* pass the content fragment itself to read it. A shadow tree is not among its
|
|
60
|
+
* host's children either: pass the shadow root, a `"fragment"`.
|
|
61
|
+
* - `namespacesInScopeOf` (or `namespacesInScopeWithin` with a work budget) reads
|
|
62
|
+
* the declaration attributes of the element and its element ancestors, as
|
|
63
|
+
* `markupNamespacesFromAttributes` does. An element created with
|
|
64
|
+
* `createElementNS` and no declaration therefore brings no binding for its
|
|
65
|
+
* own prefix, where the DOM's `lookupNamespaceURI` answers one.
|
|
66
|
+
* - `kindOf` throws `TypeError` for a node no tree holds (an `Attr`), the element
|
|
67
|
+
* accessors for a node that is not an element, and `documentModeOf` for a
|
|
68
|
+
* node other than a document without an owner document.
|
|
69
|
+
*
|
|
70
|
+
* Every member is O(1) but `namespacesInScopeOf`, O(depth + attributes on the
|
|
71
|
+
* ancestor chain). There is no `siblingIndexOf`, `compareDocumentOrder` or
|
|
72
|
+
* `elementByIdOf`: the DOM answers none of them in O(1) for every root, so an
|
|
73
|
+
* engine scans, or `indexMarkupTree` snapshots a tree read more than once.
|
|
74
|
+
* Without an index the tree is read live, as it is at each call.
|
|
75
|
+
*/
|
|
76
|
+
export declare const domMarkupShape: MarkupTreeShape<DomNodeLike, DomAttrLike>;
|
|
77
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dom/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGX,eAAe,EACf,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAC5C,kCAAkC;IAClC,QAAQ,CAAC,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;CAC/C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC3C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,uBAAuB;AACvB,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CAC5C,CAAC;AAEF,oBAAoB;AACpB,MAAM,MAAM,WAAW,GAAG;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,qCAAqC;AACrC,MAAM,MAAM,4BAA4B,GAAG,oBAAoB,GAAG;IACjE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB,CAAC;AA8EF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,cAAc,EAAE,eAAe,CAAC,WAAW,EAAE,WAAW,CAoBpE,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { markupNamespacesFromAttributes } from "../markup-namespace-scope.js";
|
|
2
|
+
// The DOM's `Node.*_NODE` values, spelt out so that no global is read.
|
|
3
|
+
const ELEMENT_NODE_ = 1;
|
|
4
|
+
const TEXT_NODE_ = 3;
|
|
5
|
+
const CDATA_SECTION_NODE_ = 4;
|
|
6
|
+
const PROCESSING_INSTRUCTION_NODE_ = 7;
|
|
7
|
+
const COMMENT_NODE_ = 8;
|
|
8
|
+
const DOCUMENT_NODE_ = 9;
|
|
9
|
+
const DOCUMENT_TYPE_NODE_ = 10;
|
|
10
|
+
const DOCUMENT_FRAGMENT_NODE_ = 11;
|
|
11
|
+
function isElement_(node) {
|
|
12
|
+
return node.nodeType === ELEMENT_NODE_;
|
|
13
|
+
}
|
|
14
|
+
function isDocument_(node) {
|
|
15
|
+
return node.nodeType === DOCUMENT_NODE_;
|
|
16
|
+
}
|
|
17
|
+
function isCharacterData_(node) {
|
|
18
|
+
const { nodeType } = node;
|
|
19
|
+
return (nodeType === TEXT_NODE_ ||
|
|
20
|
+
nodeType === CDATA_SECTION_NODE_ ||
|
|
21
|
+
nodeType === COMMENT_NODE_ ||
|
|
22
|
+
nodeType === PROCESSING_INSTRUCTION_NODE_);
|
|
23
|
+
}
|
|
24
|
+
function isProcessingInstruction_(node) {
|
|
25
|
+
return node.nodeType === PROCESSING_INSTRUCTION_NODE_;
|
|
26
|
+
}
|
|
27
|
+
function asElement_(node) {
|
|
28
|
+
if (!isElement_(node)) {
|
|
29
|
+
throw new TypeError(`DOM node of type ${node.nodeType} is not an element`);
|
|
30
|
+
}
|
|
31
|
+
return node;
|
|
32
|
+
}
|
|
33
|
+
function kindOf(node) {
|
|
34
|
+
switch (node.nodeType) {
|
|
35
|
+
case ELEMENT_NODE_:
|
|
36
|
+
return "element";
|
|
37
|
+
case TEXT_NODE_:
|
|
38
|
+
case CDATA_SECTION_NODE_:
|
|
39
|
+
return "text";
|
|
40
|
+
case COMMENT_NODE_:
|
|
41
|
+
return "comment";
|
|
42
|
+
case PROCESSING_INSTRUCTION_NODE_:
|
|
43
|
+
return "processingInstruction";
|
|
44
|
+
case DOCUMENT_NODE_:
|
|
45
|
+
return "document";
|
|
46
|
+
case DOCUMENT_TYPE_NODE_:
|
|
47
|
+
return "doctype";
|
|
48
|
+
case DOCUMENT_FRAGMENT_NODE_:
|
|
49
|
+
return "fragment";
|
|
50
|
+
default:
|
|
51
|
+
throw new TypeError(`DOM node of type ${node.nodeType} is not a node of a tree`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function documentModeOf(node) {
|
|
55
|
+
const document = isDocument_(node) ? node : node.ownerDocument;
|
|
56
|
+
if (document === null) {
|
|
57
|
+
throw new TypeError("DOM node without an owner document");
|
|
58
|
+
}
|
|
59
|
+
if (document.contentType !== "text/html") {
|
|
60
|
+
return "xml";
|
|
61
|
+
}
|
|
62
|
+
return document.compatMode === "BackCompat" ? "html-quirks" : "html";
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A {@link MarkupTreeShape} over a W3C DOM — a browser's, or jsdom's — read
|
|
66
|
+
* through the standard `Node`, `Element`, `Attr`, `CharacterData` and
|
|
67
|
+
* `ProcessingInstruction` members only, so it reads no global and works in any
|
|
68
|
+
* realm.
|
|
69
|
+
*
|
|
70
|
+
* - The document mode is the owner document's: `"xml"` unless its `contentType`
|
|
71
|
+
* is `"text/html"` (an XHTML document is XML), and `"html-quirks"` when its
|
|
72
|
+
* `compatMode` is `"BackCompat"`. A detached node keeps its owner document,
|
|
73
|
+
* so the mode is uniform over every tree and answered in O(1).
|
|
74
|
+
* - Names, namespaces and prefixes are the DOM's own, already `null` for none:
|
|
75
|
+
* the HTML parser's elements carry no prefix, and its `xmlns` and
|
|
76
|
+
* `xmlns:xlink` on foreign elements are in `XMLNS_NAMESPACE`, as an XML
|
|
77
|
+
* parser's declarations are.
|
|
78
|
+
* - A CDATA section is `"text"`. A template's content is not among its children;
|
|
79
|
+
* pass the content fragment itself to read it. A shadow tree is not among its
|
|
80
|
+
* host's children either: pass the shadow root, a `"fragment"`.
|
|
81
|
+
* - `namespacesInScopeOf` (or `namespacesInScopeWithin` with a work budget) reads
|
|
82
|
+
* the declaration attributes of the element and its element ancestors, as
|
|
83
|
+
* `markupNamespacesFromAttributes` does. An element created with
|
|
84
|
+
* `createElementNS` and no declaration therefore brings no binding for its
|
|
85
|
+
* own prefix, where the DOM's `lookupNamespaceURI` answers one.
|
|
86
|
+
* - `kindOf` throws `TypeError` for a node no tree holds (an `Attr`), the element
|
|
87
|
+
* accessors for a node that is not an element, and `documentModeOf` for a
|
|
88
|
+
* node other than a document without an owner document.
|
|
89
|
+
*
|
|
90
|
+
* Every member is O(1) but `namespacesInScopeOf`, O(depth + attributes on the
|
|
91
|
+
* ancestor chain). There is no `siblingIndexOf`, `compareDocumentOrder` or
|
|
92
|
+
* `elementByIdOf`: the DOM answers none of them in O(1) for every root, so an
|
|
93
|
+
* engine scans, or `indexMarkupTree` snapshots a tree read more than once.
|
|
94
|
+
* Without an index the tree is read live, as it is at each call.
|
|
95
|
+
*/
|
|
96
|
+
export const domMarkupShape = {
|
|
97
|
+
kindOf,
|
|
98
|
+
parentOf: (node) => node.parentNode,
|
|
99
|
+
childrenOf: (node) => node.childNodes,
|
|
100
|
+
documentModeOf,
|
|
101
|
+
documentModeIsUniform: true,
|
|
102
|
+
localNameOf: (element) => asElement_(element).localName,
|
|
103
|
+
namespaceOf: (element) => asElement_(element).namespaceURI,
|
|
104
|
+
prefixOf: (element) => asElement_(element).prefix,
|
|
105
|
+
attributesOf: (element) => asElement_(element).attributes,
|
|
106
|
+
attributeLocalNameOf: (attribute) => attribute.localName,
|
|
107
|
+
attributeNamespaceOf: (attribute) => attribute.namespaceURI,
|
|
108
|
+
attributePrefixOf: (attribute) => attribute.prefix,
|
|
109
|
+
attributeValueOf: (attribute) => attribute.value,
|
|
110
|
+
dataOf: (node) => (isCharacterData_(node) ? node.data : ""),
|
|
111
|
+
targetOf: (node) => (isProcessingInstruction_(node) ? node.target : ""),
|
|
112
|
+
namespacesInScopeOf: (element) => markupNamespacesFromAttributes(domMarkupShape, element),
|
|
113
|
+
namespacesInScopeWithin: (element, budget) => markupNamespacesFromAttributes(domMarkupShape, element, budget),
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dom/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAuD9E,uEAAuE;AACvE,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,4BAA4B,GAAG,CAAC,CAAC;AACvC,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC,SAAS,UAAU,CAAC,IAAiB;IACpC,OAAO,IAAI,CAAC,QAAQ,KAAK,aAAa,CAAC;AACxC,CAAC;AAED,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;IAChD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACvE,mBAAmB,EAAE,CAAC,OAAO,EAAE,EAAE,CAChC,8BAA8B,CAAC,cAAc,EAAE,OAAO,CAAC;IACxD,uBAAuB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAC5C,8BAA8B,CAAC,cAAc,EAAE,OAAO,EAAE,MAAM,CAAC;CAChE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/model-markup",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Markup trees as a shape: elements, attributes, text and namespaces read through accessors, for XML and HTML trees alike.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dom",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"main": "./dist/index.js",
|
|
29
29
|
"exports": {
|
|
30
30
|
".": "./dist/index.js",
|
|
31
|
+
"./dom": "./dist/dom/index.js",
|
|
31
32
|
"./parse5": "./dist/parse5/index.js",
|
|
32
33
|
"./testing": "./dist/testing/index.js"
|
|
33
34
|
},
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
"main": "./dist/index.js",
|
|
36
37
|
"exports": {
|
|
37
38
|
".": "./dist/index.js",
|
|
39
|
+
"./dom": "./dist/dom/index.js",
|
|
38
40
|
"./parse5": "./dist/parse5/index.js",
|
|
39
41
|
"./testing": "./dist/testing/index.js"
|
|
40
42
|
},
|
|
@@ -49,17 +51,19 @@
|
|
|
49
51
|
"prepack": "yarn build"
|
|
50
52
|
},
|
|
51
53
|
"dependencies": {
|
|
52
|
-
"@ac-kit/algo": "^0.
|
|
53
|
-
"@ac-kit/core": "^0.
|
|
54
|
-
"@ac-kit/math-random": "^0.4.
|
|
54
|
+
"@ac-kit/algo": "^0.7.0",
|
|
55
|
+
"@ac-kit/core": "^0.14.0",
|
|
56
|
+
"@ac-kit/math-random": "^0.4.2",
|
|
55
57
|
"@types/web": "^0.0.367"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
|
-
"@ac-kit/test-util": "0.5.
|
|
60
|
+
"@ac-kit/test-util": "0.5.1",
|
|
59
61
|
"@ac-kit/tsconfig": "0.1.0",
|
|
60
62
|
"@ac-kit/typedoc-config": "0.1.0",
|
|
61
|
-
"@ac-kit/vitest-config": "0.
|
|
63
|
+
"@ac-kit/vitest-config": "0.3.0",
|
|
64
|
+
"@types/jsdom": "30.0.0",
|
|
62
65
|
"@typescript/native": "typescript@7.0.2",
|
|
66
|
+
"jsdom": "31.0.1",
|
|
63
67
|
"parse5": "8.1.1",
|
|
64
68
|
"rimraf": "6.1.4",
|
|
65
69
|
"typedoc": "0.28.20",
|