Skip to content

Commit

Permalink
fix: optional chaining to prevent type error
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Oct 16, 2024
1 parent 076c43e commit cdf8f44
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 cdf8f44

Please sign in to comment.