Skip to content

Commit

Permalink
fix(ast): rename serialized fields to camel case (#2566)
Browse files Browse the repository at this point in the history
Fixes a few more AST fields names which are currently snake case in
serialized JSON.
  • Loading branch information
overlookmotel authored Mar 2, 2024
1 parent 78f8c2c commit e339461
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down Expand Up @@ -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))]
Expand Down Expand Up @@ -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))]
Expand Down

0 comments on commit e339461

Please sign in to comment.