fix(ast): rename serialized fields to camel case (#2566)

Fixes a few more AST fields names which are currently snake case in
serialized JSON.
This commit is contained in:
overlookmotel 2024-03-02 14:47:29 +00:00 committed by GitHub
parent 78f8c2ce7f
commit e339461a9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -383,7 +383,7 @@ pub struct ThisExpression {
/// <https://tc39.es/ecma262/#prod-ArrayLiteral>
#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub struct ArrayExpression<'a> {
#[cfg_attr(feature = "serde", serde(flatten))]
@ -414,7 +414,7 @@ impl<'a> ArrayExpressionElement<'a> {
/// Object Expression
#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub struct ObjectExpression<'a> {
#[cfg_attr(feature = "serde", serde(flatten))]
@ -968,7 +968,7 @@ pub enum AssignmentTargetPattern<'a> {
}
#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub struct ArrayAssignmentTarget<'a> {
#[cfg_attr(feature = "serde", serde(flatten))]