Skip to content

Commit

Permalink
perf(nuxt): reduce multiple calls to .toLowerCase() (#22743)
Browse files Browse the repository at this point in the history
  • Loading branch information
djixadin authored and danielroe committed Aug 23, 2023
1 parent 7d82057 commit 1d9eced
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nuxt/src/components/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export async function scanComponents (dirs: ComponentsDir[], srcDir: string): Pr

const directory = basename(dir.path)
if (!siblings.includes(directory)) {
const caseCorrected = siblings.find(sibling => sibling.toLowerCase() === directory.toLowerCase())
const directoryLowerCase = directory.toLowerCase()
const caseCorrected = siblings.find(sibling => sibling.toLowerCase() === directoryLowerCase)
if (caseCorrected) {
const nuxt = useNuxt()
const original = relative(nuxt.options.srcDir, dir.path)
Expand Down

0 comments on commit 1d9eced

Please sign in to comment.