Skip to content

Commit

Permalink
Merge pull request #637 from kanadgupta/main
Browse files Browse the repository at this point in the history
fix: optional chaining to prevent type error
  • Loading branch information
mdonnalley authored Oct 16, 2024
2 parents 076c43e + cdf8f44 commit 3e0a3d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function findRoot(): string {
return (
process.env.OCLIF_TEST_ROOT ??
// eslint-disable-next-line unicorn/prefer-module
Object.values(require.cache).find((m) => m?.children.includes(module))?.filename ??
Object.values(require.cache).find((m) => m?.children?.includes(module))?.filename ??
traverseFilePathUntil(
// eslint-disable-next-line unicorn/prefer-module
require.main?.path ?? module.path,
Expand Down

0 comments on commit 3e0a3d1

Please sign in to comment.