Skip to content

Commit

Permalink
fix: type getVariableValue helper
Browse files Browse the repository at this point in the history
  • Loading branch information
adamviktora committed Oct 23, 2024
1 parent 8805761 commit 0bb13f7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
JSXFragment,
JSXOpeningElement,
MemberExpression,
Property,
} from "estree-jsx";

export function getAttribute(
Expand Down Expand Up @@ -128,12 +129,12 @@ export function getVariableValue(
);
}
if (variableInit.type === "Literal") {
return variableInit.value;
return variableInit.value as string;
}
if (variableInit.type === "MemberExpression") {
return getMemberExpression(variableInit);
}
if (variableInit.type === "ObjectExpression") {
return variableInit.properties;
return variableInit.properties as Property[];
}
}

0 comments on commit 0bb13f7

Please sign in to comment.