You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-31Lines changed: 3 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,38 +137,10 @@ assert.deepEqual(
137
137
138
138
The package exports two functions from `@bgotink/kdl/v1-compat` to support documents written in KDL v1:
139
139
140
-
- `parseWithoutFormatting` parses a KDL v1 document without storing any formatting information.
141
-
If the resulting document is passed to `format()`, a fresh KDL v2 document will be produced and any comments or formatting added by the original document's author will be lost.
142
-
- `parseAndTransform` parses a KDL v1 document and transforms all linked formatting information to turn it into a valid KDL v2 document.
140
+
- `parse` parses a KDL v1 document and transforms all linked formatting information to turn it into a valid KDL v2 document.
143
141
If the resulting document is passed to `format()`, the resulting string will be the same document but in KDL v2 syntax. It will include all comments and formatting applied by the original document's author.
144
-
145
-
These functions embed the 0.1.x version of this package as parser for KDL v1.
146
-
This old parser is many times larger and a lot slower than the parser written for KDL v2.
147
-
As such, it is advised to lazy-load the KDL v1 support only if needed.
148
-
For example, if you want to read configuration that can be KDL v2 or v1:
- `parseCompat` parses a document that's either KDL v2 or KDL v1 and returns a valid KDL v2 document.
143
+
This is a helper function that combines the regular `parse` function with the v1-compat `parse` function into a single function that supports both formats.
0 commit comments