@decimalturn/toml-patch 3.0.3 → 3.0.4
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 +24 -640
- package/dist/toml-patch.d.ts +12 -0
- package/dist/toml-patch.js +35 -24
- package/package.json +5 -4
- package/CHANGELOG.md +0 -400
package/dist/toml-patch.d.ts
CHANGED
|
@@ -381,6 +381,12 @@ declare class TomlDocument {
|
|
|
381
381
|
/**
|
|
382
382
|
* Applies a patch to the current CST using a modified JS object.
|
|
383
383
|
* Updates the internal CST. Use toTomlString getter to retrieve the updated TOML string.
|
|
384
|
+
*
|
|
385
|
+
* The result is verified internally: the produced TOML is re-parsed and checked
|
|
386
|
+
* against `updatedObject`, retrying with a coarser writer if it does not match.
|
|
387
|
+
* A patch that neither attempt can satisfy commits the fine-grained result, with
|
|
388
|
+
* the CST re-derived from it so the document and its TOML string stay in step.
|
|
389
|
+
*
|
|
384
390
|
* @param updatedObject - The modified JS object to patch with
|
|
385
391
|
* @param format - Optional formatting options
|
|
386
392
|
*/
|
|
@@ -408,6 +414,12 @@ declare class TomlDocument {
|
|
|
408
414
|
* and updated data, then strategically applies only the necessary changes to maintain the
|
|
409
415
|
* original document structure as much as possible.
|
|
410
416
|
*
|
|
417
|
+
* The result is verified internally: the output is re-parsed and checked against
|
|
418
|
+
* `updated`, and if it does not round-trip the patch is retried with a coarser
|
|
419
|
+
* writer that rewrites whole multiline inline containers. A patch that neither
|
|
420
|
+
* attempt can satisfy returns the fine-grained result, so this never fails where
|
|
421
|
+
* earlier versions succeeded.
|
|
422
|
+
*
|
|
411
423
|
* @param existing - The original TOML document as a string
|
|
412
424
|
* @param updated - The updated JavaScript object with desired changes
|
|
413
425
|
* @param format - Optional formatting options to apply to new or modified sections
|