tatethurston / nextjs-routes

Type safe routing for Next.js
MIT License
553 stars 20 forks source link

Update filter method get more strict type #148

Closed po4tion closed 1 year ago

po4tion commented 1 year ago
  const dirs = [
    getPagesDirectory(process.cwd()),
    getAppDirectory(process.cwd()),
  ].filter((x) => x != undefined);

In this case, "type" is specified as "(string | undefined)[]" even though the dirs variable cannot be an array with undefined. I supplemented this point.