From 2251f01cea5ddcf8ed1aa3f46e4563f25435aa31 Mon Sep 17 00:00:00 2001 From: lobomfz Date: Sat, 20 Jul 2024 19:10:07 -0300 Subject: [PATCH] fix: IfDefined returning any --- .changeset/warm-carrots-learn.md | 5 +++++ packages/core/src/utils.ts | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/warm-carrots-learn.md diff --git a/.changeset/warm-carrots-learn.md b/.changeset/warm-carrots-learn.md new file mode 100644 index 00000000..b074367e --- /dev/null +++ b/.changeset/warm-carrots-learn.md @@ -0,0 +1,5 @@ +--- +"@typeschema/core": minor +--- + +Fixes detection of installed adapters diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index 16760479..87f2c41e 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -1,7 +1,6 @@ import type {Resolver, SchemaFrom} from './resolver'; -export type IfDefined = 0 extends 1 & - TValue +export type IfDefined = unknown extends TValue ? TModule extends '' ? never : `Cannot find module '${TModule}'`