@decimalturn/toml-patch 3.1.2-dev → 3.2.0-dev
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/dist/dev/comment-alignment.js +1 -1
- package/dist/dev/comment-ownership.js +1 -1
- package/dist/dev/cst-source.js +1 -1
- package/dist/dev/cst.js +11 -2
- package/dist/dev/cst.js.map +1 -1
- package/dist/dev/cursor.js +1 -1
- package/dist/dev/date-format.js +1 -1
- package/dist/dev/decode-utf8.js +1 -1
- package/dist/dev/diff-lite.js +123 -0
- package/dist/dev/diff-lite.js.map +1 -0
- package/dist/dev/diff.js +4 -8
- package/dist/dev/diff.js.map +1 -1
- package/dist/dev/encode-lite.js +193 -0
- package/dist/dev/encode-lite.js.map +1 -0
- package/dist/dev/escape-preference.js +33 -11
- package/dist/dev/escape-preference.js.map +1 -1
- package/dist/dev/find-by-path.js +1 -1
- package/dist/dev/formatter.js +9 -9
- package/dist/dev/formatter.js.map +1 -1
- package/dist/dev/generate.js +53 -39
- package/dist/dev/generate.js.map +1 -1
- package/dist/dev/inline-comma-space.js +1 -1
- package/dist/dev/inline-format.js +1 -1
- package/dist/dev/inline-layout.js +1 -1
- package/dist/dev/line-ending-backslash.js +1 -1
- package/dist/dev/literal-string.js +46 -0
- package/dist/dev/literal-string.js.map +1 -0
- package/dist/dev/location.js +1 -1
- package/dist/dev/parse-error.js +1 -1
- package/dist/dev/parse-js.js +49 -6
- package/dist/dev/parse-js.js.map +1 -1
- package/dist/dev/parse-string.js +1 -1
- package/dist/dev/parse-toml.js +1 -1
- package/dist/dev/patch-lite.js +4 -0
- package/dist/dev/patch-lite2.js +96 -0
- package/dist/dev/patch-lite2.js.map +1 -0
- package/dist/dev/patch.js +150 -38
- package/dist/dev/patch.js.map +1 -1
- package/dist/dev/smol-toml-date.js +61 -0
- package/dist/dev/smol-toml-date.js.map +1 -0
- package/dist/dev/to-js.js +1 -1
- package/dist/dev/to-toml.js +1 -1
- package/dist/dev/tokenizer.js +1 -1
- package/dist/dev/toml-document.js +1 -1
- package/dist/dev/toml-format.js +58 -6
- package/dist/dev/toml-format.js.map +1 -1
- package/dist/dev/toml-patch.js +1 -1
- package/dist/dev/traverse.js +1 -1
- package/dist/dev/truncate.js +1 -1
- package/dist/dev/update-order.js +1 -1
- package/dist/dev/utils.js +26 -5
- package/dist/dev/utils.js.map +1 -1
- package/dist/dev/writer.js +1 -1
- package/dist/patch-lite.d.ts +18 -0
- package/dist/toml-patch.d.ts +7 -1
- package/package.json +6 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/patch-lite.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Applies in-place value edits to an existing TOML document.
|
|
5
|
+
*
|
|
6
|
+
* This is an edit-only distribution: every change must be an edit to an
|
|
7
|
+
* existing scalar value. Added or removed keys, array length changes, array
|
|
8
|
+
* reordering, key renames and scalar/container type changes all throw before
|
|
9
|
+
* the source is mutated. All text outside the edited value spans is preserved
|
|
10
|
+
* byte for byte.
|
|
11
|
+
*
|
|
12
|
+
* @param existing - The original TOML document as a string
|
|
13
|
+
* @param updated - The updated JavaScript object with desired value changes
|
|
14
|
+
* @returns A new TOML string with only the edited values replaced
|
|
15
|
+
*/
|
|
16
|
+
declare function patchLite(existing: string, updated: any): string;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { patchLite as patch };
|
package/dist/toml-patch.d.ts
CHANGED
|
@@ -124,7 +124,13 @@ export declare class TomlFormat {
|
|
|
124
124
|
* keeps new containers compact and `'parent'` follows the immediate parent.
|
|
125
125
|
*/
|
|
126
126
|
multilineArray: MultilineContainerMode;
|
|
127
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Whether to write `\uXXXX` / `\UXXXXXXXX` / `\xHH` escape sequences with
|
|
129
|
+
* uppercase hex digits. Auto-detected from the first hex escape sequence in
|
|
130
|
+
* the document during patching; defaults to `true` (uppercase hex).
|
|
131
|
+
*/
|
|
132
|
+
escapeSequenceUpperCase: boolean;
|
|
133
|
+
constructor(newLine?: string, trailingNewline?: number, trailingComma?: boolean, bracketSpacing?: boolean, inlineTableStart?: number, truncateZeroTimeInDates?: boolean, useTabsForIndentation?: boolean, minimumDecimals?: number, leadingBom?: boolean, updateOrder?: boolean, indentWidth?: number, multilineTable?: MultilineContainerMode | null, multilineArray?: MultilineContainerMode | null, escapeSequenceUpperCase?: boolean);
|
|
128
134
|
/**
|
|
129
135
|
* Creates a new TomlFormat instance with default formatting preferences.
|
|
130
136
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decimalturn/toml-patch",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-dev",
|
|
4
4
|
"description": "Patch, parse, and stringify TOML while preserving comments, whitespace and formatting.",
|
|
5
5
|
"homepage": "https://github.com/DecimalTurn/toml-patch",
|
|
6
6
|
"repository": {
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
"types": "./dist/toml-patch.d.ts",
|
|
23
23
|
"import": "./dist/dev/toml-patch.js",
|
|
24
24
|
"default": "./dist/dev/toml-patch.js"
|
|
25
|
+
},
|
|
26
|
+
"./patch-lite": {
|
|
27
|
+
"types": "./dist/patch-lite.d.ts",
|
|
28
|
+
"import": "./dist/dev/patch-lite.js",
|
|
29
|
+
"default": "./dist/dev/patch-lite.js"
|
|
25
30
|
}
|
|
26
31
|
},
|
|
27
32
|
"publishConfig": {
|