diff --git a/.changeset/stupid-pans-peel.md b/.changeset/stupid-pans-peel.md new file mode 100644 index 0000000..474cd6d --- /dev/null +++ b/.changeset/stupid-pans-peel.md @@ -0,0 +1,6 @@ +--- +'@typeschema/main': minor +'@typeschema/all': patch +--- + +Remove type dependencies on schema selector diff --git a/packages/all/src/__tests__/effect.test.ts b/packages/all/src/__tests__/effect.test.ts index d38e44a..f4f263e 100644 --- a/packages/all/src/__tests__/effect.test.ts +++ b/packages/all/src/__tests__/effect.test.ts @@ -31,7 +31,6 @@ describe('effect', () => { name: Schema.String, updatedAt: DateFromString, }); - console.log(typeof schema); const data = readonly({ age: 123, diff --git a/packages/effect/src/__tests__/effect.test.ts b/packages/effect/src/__tests__/effect.test.ts index 9270a00..352ce9b 100644 --- a/packages/effect/src/__tests__/effect.test.ts +++ b/packages/effect/src/__tests__/effect.test.ts @@ -27,7 +27,6 @@ describe('effect', () => { name: Schema.String, updatedAt: DateFromString, }); - console.log(typeof schema); const data = readonly({ age: 123, diff --git a/packages/main/src/__tests__/effect.test.ts b/packages/main/src/__tests__/effect.test.ts index d38e44a..f4f263e 100644 --- a/packages/main/src/__tests__/effect.test.ts +++ b/packages/main/src/__tests__/effect.test.ts @@ -31,7 +31,6 @@ describe('effect', () => { name: Schema.String, updatedAt: DateFromString, }); - console.log(typeof schema); const data = readonly({ age: 123, diff --git a/packages/main/src/selector.ts b/packages/main/src/selector.ts index 9cb7990..1178d59 100644 --- a/packages/main/src/selector.ts +++ b/packages/main/src/selector.ts @@ -1,11 +1,10 @@ import type {AdapterResolvers} from './adapters'; import type {AdapterResolver} from './resolver'; -import type {IfDefined, SchemaFrom} from '@typeschema/core'; -import type {CoreValidator} from 'suretype'; +import type {SchemaFrom} from '@typeschema/core'; // prettier-ignore type IsTypeboxSchema = - TSchema extends {static: unknown, params: unknown[]} ? true + TSchema extends {static: unknown, params: unknown} ? true : false; function isTypeboxSchema( schema: SchemaFrom, @@ -15,8 +14,7 @@ function isTypeboxSchema( // prettier-ignore type IsSuretypeSchema = - [IfDefined>] extends [never] ? false - : TSchema extends CoreValidator ? true + TSchema extends {required: () => {constructor: unknown}} ? true : false; function isSuretypeSchema( schema: SchemaFrom,