-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[codemod] Add
theme-v6
migration (#42056)
- Loading branch information
1 parent
450c4f6
commit 0824b98
Showing
23 changed files
with
4,233 additions
and
2,014 deletions.
There are no files selected for viewing
383 changes: 224 additions & 159 deletions
383
docs/data/material/getting-started/templates/checkout/getCheckoutTheme.js
Large diffs are not rendered by default.
Oops, something went wrong.
383 changes: 224 additions & 159 deletions
383
docs/data/material/getting-started/templates/checkout/getCheckoutTheme.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
360 changes: 209 additions & 151 deletions
360
docs/data/material/getting-started/templates/landing-page/getLPTheme.js
Large diffs are not rendered by default.
Oops, something went wrong.
360 changes: 209 additions & 151 deletions
360
docs/data/material/getting-started/templates/landing-page/getLPTheme.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
352 changes: 205 additions & 147 deletions
352
docs/data/material/getting-started/templates/sign-in-side/getSignInSideTheme.js
Large diffs are not rendered by default.
Oops, something went wrong.
352 changes: 205 additions & 147 deletions
352
docs/data/material/getting-started/templates/sign-in-side/getSignInSideTheme.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
352 changes: 205 additions & 147 deletions
352
docs/data/material/getting-started/templates/sign-in/getSignInTheme.js
Large diffs are not rendered by default.
Oops, something went wrong.
352 changes: 205 additions & 147 deletions
352
docs/data/material/getting-started/templates/sign-in/getSignInTheme.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
352 changes: 205 additions & 147 deletions
352
docs/data/material/getting-started/templates/sign-up/getSignUpTheme.js
Large diffs are not rendered by default.
Oops, something went wrong.
352 changes: 205 additions & 147 deletions
352
docs/data/material/getting-started/templates/sign-up/getSignUpTheme.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @param {import('ast-types').namedTypes.ArrowFunctionExpression | import('ast-types').namedTypes.FunctionExpression} node | ||
*/ | ||
export default function getReturnExpression(node) { | ||
let body = node.body; | ||
if (body === 'BlockStatement') { | ||
body = body.body; | ||
} | ||
|
||
if (Array.isArray(body)) { | ||
return body.find((statement) => statement.type === 'ReturnStatement')?.argument; | ||
} | ||
return body; | ||
} |
Oops, something went wrong.