diff options
Diffstat (limited to 'packages/integrations/vue')
-rw-r--r-- | packages/integrations/vue/src/editor.cts | 4 | ||||
-rw-r--r-- | packages/integrations/vue/test/app-entrypoint.test.js | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/packages/integrations/vue/src/editor.cts b/packages/integrations/vue/src/editor.cts index 0b62e899e..0c9642d67 100644 --- a/packages/integrations/vue/src/editor.cts +++ b/packages/integrations/vue/src/editor.cts @@ -23,7 +23,7 @@ export function toTSX(code: string, className: string): string { const { scriptSetup } = parsedResult.descriptor; if (scriptSetup) { - const definePropsType = scriptSetup.content.match(/defineProps<([\S\s]+?)>\s?\(\)/m); + const definePropsType = scriptSetup.content.match(/defineProps<([\s\S]+?)>\s?\(\)/); const propsGeneric = scriptSetup.attrs.generic; const propsGenericType = propsGeneric ? `<${propsGeneric}>` : ''; @@ -40,7 +40,7 @@ export function toTSX(code: string, className: string): string { // TODO. Find a way to support generics when using defineProps without passing explicit types. // Right now something like this `defineProps({ prop: { type: Array as PropType<T[]> } })` // won't be correctly typed in Astro. - const defineProps = scriptSetup.content.match(/defineProps\([\s\S]+\)/m); + const defineProps = scriptSetup.content.match(/defineProps\([\s\S]+\)/); if (defineProps) { result = ` diff --git a/packages/integrations/vue/test/app-entrypoint.test.js b/packages/integrations/vue/test/app-entrypoint.test.js index 5cdae3c04..5c0437636 100644 --- a/packages/integrations/vue/test/app-entrypoint.test.js +++ b/packages/integrations/vue/test/app-entrypoint.test.js @@ -41,7 +41,7 @@ describe('App Entrypoint', () => { assert.notEqual(client, undefined); const js = await fixture.readFile(client); - assert.match(js, /\w+\.component\(\"Bar\"/gm); + assert.match(js, /\w+\.component\("Bar"/g); }); it('loads svg components without transforming them to assets', async () => { @@ -112,7 +112,7 @@ describe('App Entrypoint no export default', () => { const client = island.getAttribute('renderer-url'); assert.notEqual(client, undefined); const js = await fixture.readFile(client); - assert.doesNotMatch(js, /\w+\.component\(\"Bar\"/gm); + assert.doesNotMatch(js, /\w+\.component\("Bar"/g); }); it('loads svg components without transforming them to assets', async () => { @@ -151,7 +151,7 @@ describe('App Entrypoint relative', () => { assert.notEqual(client, undefined); const js = await fixture.readFile(client); - assert.doesNotMatch(js, /\w+\.component\(\"Bar\"/gm); + assert.doesNotMatch(js, /\w+\.component\("Bar"/g); }); }); @@ -182,7 +182,7 @@ describe('App Entrypoint /src/absolute', () => { assert.notEqual(client, undefined); const js = await fixture.readFile(client); - assert.doesNotMatch(js, /\w+\.component\(\"Bar\"/gm); + assert.doesNotMatch(js, /\w+\.component\("Bar"/g); }); }); |