We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d87e976 commit 902db58Copy full SHA for 902db58
polaris.shopify.com/src/components/CodesandboxButton/CodesandboxButton.tsx
@@ -4,7 +4,7 @@ import styles from './CodesandboxButton.module.scss';
4
const getAppCode = (code: string) => {
5
const lineWithFunctionName = code
6
.split('\n')
7
- .filter((name) => name.match(/function .*Example/g))?.[0];
+ .filter((name) => name.match(/function\s+(\w+)\s*\(/))?.[0];
8
const functionName = lineWithFunctionName
9
? lineWithFunctionName.replace('function ', '').replace('() {', '')
10
: 'Example';
0 commit comments