Skip to content

Commit

Permalink
fix(find): correctly idenfity promise returned from cache (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikg authored Sep 2, 2023
1 parent 03ad886 commit 7c055a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-hairs-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tsconfck': patch
---

fix(find): only call then on promise in cache"
4 changes: 2 additions & 2 deletions packages/tsconfck/src/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ function findUp(dir, promise, done, cache, root) {
if (cache) {
if (cache.hasTSConfigPath(dir)) {
const cached = cache.getTSConfigPath(dir);
if (cached.then) {
cached.then(done).catch((err) => done(null, err));
if (cached?.then) {
/** @type Promise<string|null> */ cached.then(done).catch((err) => done(null, err));
} else {
done(/**@type {string|null} */ (cached));
}
Expand Down

0 comments on commit 7c055a7

Please sign in to comment.