Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroHryshyn committed Aug 1, 2024
1 parent 5e827d9 commit 0ea40f0
Show file tree
Hide file tree
Showing 4 changed files with 458 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ const addGetDataFunctionInline: ModFunction<File, "write"> = (
if (j.ObjectExpression.check(argument)) {
argument.properties.forEach((property) => {
if (
(!j.Property.check(property) &&
(!j.ObjectProperty.check(property) &&
!j.ObjectProperty.check(property)) ||
!j.ObjectExpression.check(property.value) ||
!j.Identifier.check(property.key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ function transform(
j.identifier("data"),
j.identifier(sessionVar),
),
j.property(
"init",
j.identifier("status"),
j.identifier("status"),
),
j.property.from({
key: j.identifier("status"),
value: j.identifier("status"),
kind: "init",
shorthand: true,
}),
]);

// Add a new variable declaration for loading
Expand All @@ -66,7 +67,7 @@ function transform(
// Ensure the status property is not renamed
declarator.id.properties.forEach((property) => {
if (
j.Property.check(property) &&
j.ObjectProperty.check(property) &&
j.Identifier.check(property.key) &&
property.key.name === "status"
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function transform(
) {
if (
j.BooleanLiteral.check(prop.value) ||
(j.Literal.check(prop.value) &&
(j.StringLiteral.check(prop.value) &&
typeof prop.value.value === "boolean")
) {
prop.value = j.stringLiteral(
Expand Down
Loading

0 comments on commit 0ea40f0

Please sign in to comment.