12 Commits
Author SHA1 Message Date
Andrey Sitnik 69d5b399fd Fix Maximum call stack size exceeded error 2026-07-11 19:06:38 +00:00
Sarath FrancisandGitHub be16af8528 Preserve node raws when rehydrating a JSON AST (#2100)
fromJSON() attached child nodes through the container constructor, which
runs them back through append()/normalize(). For root-level children that
re-applies insertion spacing normalization and overwrites each node's own
raws.before with the previous sibling's, so toJSON() -> fromJSON() was not
lossless: stylesheets with non-uniform blank lines between top-level rules
came back with their spacing flattened.

Rehydrate children separately and attach them directly, keeping the raws
exactly as serialized.
2026-06-28 12:56:11 +02:00
Andrey Sitnik 19afb318d6 Sort source code and fix ESLint 2024-08-31 23:26:27 +02:00
Andrey Sitnik 843ab11b6e Add Prettier 2021-03-11 19:11:37 -05:00
Niklas Mischkulnig b3405e610c Fix JSON.stringify of an array of nodes 2021-01-07 12:04:45 +01:00
Niklas Mischkulnig e9675f1453 Cleanup 2020-12-09 12:46:09 +01:00
Niklas Mischkulnig 1142d0f544 Rename to input/inputId 2020-12-09 12:31:53 +01:00
Niklas Mischkulnig bf6ce4b9fb Deduplicate Input objects in JSON 2020-12-09 12:31:53 +01:00
Niklas Mischkulnig fd91269044 All nodes have a source property, not just Root 2020-12-09 12:31:53 +01:00
Andrey Sitnik 4f8122e557 Clean up fromJSON 2020-12-05 19:36:10 -05:00
Niklas Mischkulnig 781e433bdb Add missing test, linting, typings 2020-12-05 11:07:00 +01:00
Niklas Mischkulnig ec69e352d9 fromJSON and toJSON 2020-12-05 00:15:24 +01:00