satorigear 0.0.9 → 0.0.11
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/README.md +13 -12
- package/dist/index.d.mts +10 -24
- package/dist/index.mjs +1276 -1443
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,11 +65,12 @@ const mdast = document.tree;
|
|
|
65
65
|
|
|
66
66
|
## Performance
|
|
67
67
|
|
|
68
|
-
Benchmarked against Sätteri <sup>0.
|
|
68
|
+
Benchmarked against Sätteri <sup>0.11.6</sup> and Remark (`mdast-util-from-markdown@2.0.3`), which also produce MDAST, with feature sets kept as equivalent as possible for each profile.
|
|
69
69
|
|
|
70
70
|
<!-- benchmark:start environment -->
|
|
71
71
|
|
|
72
|
-
> Median of 4 isolated mean-time runs at commit [`
|
|
72
|
+
> Median of 4 isolated mean-time runs at commit [`8b18675`](https://github.com/KazariEX/satorigear/commit/8b186759a29a6fff7c56306a2523146004c127a2) on Apple M3, node 26.5.0, arm64-darwin.
|
|
73
|
+
> SatoriGear and Sätteri run in paired AB/BA order; comparisons are normalized to SatoriGear (↑ faster, ↓ slower). Lower time and higher throughput are better.
|
|
73
74
|
|
|
74
75
|
<!-- benchmark:end -->
|
|
75
76
|
|
|
@@ -81,17 +82,17 @@ Benchmarked against Sätteri <sup>0.10.5</sup> and Remark (`mdast-util-from-mark
|
|
|
81
82
|
|
|
82
83
|
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
83
84
|
| --- | ---: | ---: | ---: |
|
|
84
|
-
| **SatoriGear** |
|
|
85
|
-
| Sätteri |
|
|
86
|
-
| Remark |
|
|
85
|
+
| **SatoriGear** | 645 µs | baseline | 303 MiB/s |
|
|
86
|
+
| Sätteri | 918 µs | ↓ 1.42× | 213 MiB/s |
|
|
87
|
+
| Remark | 60.5 ms | ↓ 93.82× | 3.23 MiB/s |
|
|
87
88
|
|
|
88
89
|
#### CommonMark 0.31.2 examples, 14919 bytes, 652 documents
|
|
89
90
|
|
|
90
91
|
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
91
92
|
| --- | ---: | ---: | ---: |
|
|
92
|
-
| **SatoriGear** |
|
|
93
|
-
| Sätteri |
|
|
94
|
-
| Remark | 25.
|
|
93
|
+
| **SatoriGear** | 411 µs | baseline | 34.6 MiB/s |
|
|
94
|
+
| Sätteri | 1.44 ms | ↓ 3.50× | 9.89 MiB/s |
|
|
95
|
+
| Remark | 25.3 ms | ↓ 61.61× | 0.56 MiB/s |
|
|
95
96
|
|
|
96
97
|
### Built-in features
|
|
97
98
|
|
|
@@ -99,14 +100,14 @@ Benchmarked against Sätteri <sup>0.10.5</sup> and Remark (`mdast-util-from-mark
|
|
|
99
100
|
|
|
100
101
|
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
101
102
|
| --- | ---: | ---: | ---: |
|
|
102
|
-
| **SatoriGear** |
|
|
103
|
-
| Sätteri |
|
|
103
|
+
| **SatoriGear** | 10.4 ms | baseline | 83.5 MiB/s |
|
|
104
|
+
| Sätteri | 12.3 ms | ↓ 1.18× | 70.6 MiB/s |
|
|
104
105
|
|
|
105
106
|
#### Public APIs README, 232580 bytes, 1 document
|
|
106
107
|
|
|
107
108
|
| Engine | Mean time | vs. SatoriGear | Throughput |
|
|
108
109
|
| --- | ---: | ---: | ---: |
|
|
109
|
-
| **SatoriGear** |
|
|
110
|
-
| Sätteri |
|
|
110
|
+
| **SatoriGear** | 2.56 ms | baseline | 86.7 MiB/s |
|
|
111
|
+
| Sätteri | 2.97 ms | ↓ 1.16× | 74.8 MiB/s |
|
|
111
112
|
|
|
112
113
|
<!-- benchmark:end -->
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { Literal, Node, PhrasingContent, Root, RootContent } from "mdast";
|
|
2
|
-
//#region src/source-view.d.ts
|
|
3
2
|
interface SourceSpan {
|
|
4
3
|
end: number;
|
|
5
4
|
start: number;
|
|
6
5
|
}
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/document.d.ts
|
|
9
6
|
interface TextEdit extends SourceSpan {
|
|
10
7
|
text: string;
|
|
11
8
|
}
|
|
@@ -18,19 +15,13 @@ interface Document {
|
|
|
18
15
|
readonly tree: Root;
|
|
19
16
|
edit: (edits: readonly TextEdit[]) => EditResult;
|
|
20
17
|
}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/profile/features/formatting.d.ts
|
|
23
18
|
interface StrikethroughOptions {
|
|
24
19
|
singleTilde?: boolean;
|
|
25
20
|
}
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/profile/features/frontmatter.d.ts
|
|
28
21
|
type FrontmatterMarker = "+" | "-";
|
|
29
22
|
interface FrontmatterOptions {
|
|
30
23
|
marker: FrontmatterMarker;
|
|
31
24
|
}
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/profile/features/math/types.d.ts
|
|
34
25
|
interface MathOptions {
|
|
35
26
|
singleDollarTextMath?: boolean;
|
|
36
27
|
}
|
|
@@ -53,8 +44,6 @@ declare module "mdast" {
|
|
|
53
44
|
math: Math;
|
|
54
45
|
}
|
|
55
46
|
}
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/profile/index.d.ts
|
|
58
47
|
interface FeatureOptions {
|
|
59
48
|
attributes?: boolean;
|
|
60
49
|
binding?: boolean;
|
|
@@ -67,18 +56,14 @@ interface FeatureOptions {
|
|
|
67
56
|
table?: boolean;
|
|
68
57
|
taskList?: boolean;
|
|
69
58
|
}
|
|
70
|
-
|
|
71
|
-
//#region src/parser.d.ts
|
|
72
|
-
interface Parser {
|
|
59
|
+
export interface Parser {
|
|
73
60
|
createDocument: (source: string) => Document;
|
|
74
61
|
parse: (source: string) => Root;
|
|
75
62
|
}
|
|
76
|
-
interface ParserOptions {
|
|
63
|
+
export interface ParserOptions {
|
|
77
64
|
features?: FeatureOptions;
|
|
78
65
|
}
|
|
79
|
-
declare function createParser(options?: ParserOptions): Parser;
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/profile/features/attributes/types.d.ts
|
|
66
|
+
export declare function createParser(options?: ParserOptions): Parser;
|
|
82
67
|
type AttributeValue = string | number | boolean | null | AttributeValue[] | {
|
|
83
68
|
[key: string]: AttributeValue;
|
|
84
69
|
};
|
|
@@ -88,8 +73,6 @@ declare module "mdast" {
|
|
|
88
73
|
attributes?: Attributes;
|
|
89
74
|
}
|
|
90
75
|
}
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/profile/features/component/types.d.ts
|
|
93
76
|
interface BlockComponent extends Node {
|
|
94
77
|
type: "blockComponent";
|
|
95
78
|
name: string;
|
|
@@ -114,8 +97,6 @@ declare module "mdast" {
|
|
|
114
97
|
inlineComponent: InlineComponent;
|
|
115
98
|
}
|
|
116
99
|
}
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/profile/features/emoji/types.d.ts
|
|
119
100
|
interface Emoji extends Literal {
|
|
120
101
|
type: "emoji";
|
|
121
102
|
/** Complete shortcode source, including both colons. */
|
|
@@ -129,5 +110,10 @@ declare module "mdast" {
|
|
|
129
110
|
emoji: Emoji;
|
|
130
111
|
}
|
|
131
112
|
}
|
|
132
|
-
|
|
133
|
-
|
|
113
|
+
/**
|
|
114
|
+
* Fast replacement of [`micromark-util-normalize-identifier`](
|
|
115
|
+
* https://github.com/micromark/micromark/tree/main/packages/micromark-util-normalize-identifier
|
|
116
|
+
* ).
|
|
117
|
+
*/
|
|
118
|
+
export declare function normalizeIdentifier(identifier: string): string;
|
|
119
|
+
export type { AttributeValue, Attributes, BlockComponent, Document, EditResult, Emoji, FeatureOptions, FrontmatterMarker, FrontmatterOptions, InlineComponent, InlineMath, Math, MathOptions, StrikethroughOptions, TextEdit };
|