Skip to content

Commit

Permalink
fix: repeat logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Jul 25, 2022
1 parent bd42ebb commit 45f3457
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/vite/src/node/plugins/importMetaGlob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export async function parseImportGlob(

const globs: string[] = []

const validateLiteral = (element: Expression | SpreadElement) => {
const validateLiteral = (element: Expression | SpreadElement | null) => {
if (!element) return
if (element.type === 'Literal') {
if (typeof element.value !== 'string')
Expand All @@ -198,7 +198,6 @@ export async function parseImportGlob(

if (arg1.type === 'ArrayExpression') {
for (const element of arg1.elements) {
if (!element) continue
validateLiteral(element)
}
} else {
Expand Down

0 comments on commit 45f3457

Please sign in to comment.