Skip to content

Commit

Permalink
Remove type dependencies on schema selector
Browse files Browse the repository at this point in the history
  • Loading branch information
decs committed Oct 13, 2024
1 parent e7385a6 commit 1fa8097
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/stupid-pans-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@typeschema/main': minor
'@typeschema/all': patch
---

Remove type dependencies on schema selector
1 change: 0 additions & 1 deletion packages/all/src/__tests__/effect.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/effect/src/__tests__/effect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ describe('effect', () => {
name: Schema.String,
updatedAt: DateFromString,
});
console.log(typeof schema);

const data = readonly({
age: 123,
Expand Down
1 change: 0 additions & 1 deletion packages/main/src/__tests__/effect.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions packages/main/src/selector.ts
Original file line number Diff line number Diff line change
@@ -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> =
TSchema extends {static: unknown, params: unknown[]} ? true
TSchema extends {static: unknown, params: unknown} ? true
: false;
function isTypeboxSchema(
schema: SchemaFrom<AdapterResolver>,
Expand All @@ -15,8 +14,7 @@ function isTypeboxSchema(

// prettier-ignore
type IsSuretypeSchema<TSchema> =
[IfDefined<CoreValidator<unknown>>] extends [never] ? false
: TSchema extends CoreValidator<unknown> ? true
TSchema extends {required: () => {constructor: unknown}} ? true
: false;
function isSuretypeSchema(
schema: SchemaFrom<AdapterResolver>,
Expand Down

0 comments on commit 1fa8097

Please sign in to comment.