Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions dist/datamodel/parser/DictionaryXmlFast.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Read a dictionary XML part, or decline.
*
* `null` means "I did not read this" — never "this is broken". The caller must fall back to the
* general engine, which owns every judgement about damaged input.
*
* HOW THE STATE IS HELD, and why it is seven arrays instead of a stack of objects.
*
* The obvious shape is a `Frame` object per open element, pushed and popped. It works and it
* was the first version, and it cost one object plus one attribute array for every element in
* the file — 13.8 M allocations on the corpus's largest dictionary, all of them dying
* immediately. Dictionaries nest shallowly (single digits), so the arrays below are indexed by
* DEPTH and reused: a `<P>` at depth 3 writes over the state of the previous `<P>` at depth 3.
* The element's own object (`kids[d]`) is of course fresh each time, because it is the output.
*/
export declare function readDictionaryXmlFast(input: string): Record<string, unknown> | null;
//# sourceMappingURL=DictionaryXmlFast.d.ts.map
1 change: 1 addition & 0 deletions dist/datamodel/parser/DictionaryXmlFast.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

682 changes: 682 additions & 0 deletions dist/datamodel/parser/DictionaryXmlFast.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/datamodel/parser/DictionaryXmlFast.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions dist/datamodel/parser/XmlReader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
* caller already does.
*/
export declare function readDictionaryXml(text: string): unknown;
/**
* The same document through the general engine, with no fast path consulted.
*
* NOT for callers — `readDictionaryXml` is the reader, and reaching past it would give up the
* speed for nothing. This exists because the fast reader's entire contract is "identical to the
* general engine or `null`", and a test of that cannot go through `readDictionaryXml`: that
* would compare the fast reader against itself. The alternative was for the test to build its
* own `XMLParser` with a copy of the options above, which passes just as happily when the copy
* has gone stale — the one failure that would let the two readers diverge in production while
* the test stays green.
*/
export declare function readDictionaryXmlGeneric(text: string): unknown;
/**
* One part of a `.slx` or `.mdl` package. Engine defaults: text is trimmed, and a lone
* child stays an object, so a walker over one of these has to coerce to an array itself.
Expand Down
2 changes: 1 addition & 1 deletion dist/datamodel/parser/XmlReader.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions dist/datamodel/parser/XmlReader.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/datamodel/parser/XmlReader.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
},
"dependencies": {
"fast-xml-parser": "^5.8.0",
"fflate": "^0.8.3"
"fflate": "^0.8.3",
"strnum": "^2.4.1"
},
"devDependencies": {
"@types/node": "^26.2.0",
Expand Down
Loading
Loading