Skip to content

Commit

Permalink
fix: match component line in stringify
Browse files Browse the repository at this point in the history
fix #3
  • Loading branch information
hannoeru committed Jan 29, 2021
1 parent 4186f41 commit 5f06585
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions example/src/pages/components.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<h1>Test Components name</h1>
</template>
2 changes: 1 addition & 1 deletion src/stringify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function stringifyRoutes(
.stringify(preparedRoutes, null, 2)
.split('\n')
.map((str) => {
if (str.includes('component')) {
if (/"component":\s"\S+"/.test(str)) {
const start = '"component": "'
const startIndex = str.indexOf(start) + start.length
const endIndex = str.indexOf('",')
Expand Down

0 comments on commit 5f06585

Please sign in to comment.