Skip to content

Commit

Permalink
Merge branch 'release/v0.24.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed Aug 26, 2024
2 parents e9a910d + 5f280d6 commit afcf847
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zeed",
"type": "module",
"version": "0.24.7",
"version": "0.24.8",
"description": "🌱 Simple foundation library",
"author": {
"name": "Dirk Holtwick",
Expand Down
20 changes: 10 additions & 10 deletions src/common/schema/schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { first, isBoolean, isFunction, isInteger, isNumber, isObject, isString } from '../data'
import type { Expect, IsEqual } from './test'

export interface TypeProps {
}
Expand Down Expand Up @@ -214,23 +213,24 @@ export function tuple<T extends [] | [Type, ...Type[]]>(items: T): ArrayType<T,
})
}

const tt = tuple([number(), string(), boolean()])
type ttt = Infer<typeof tt> // expected [number, string, boolean]
// const tt = tuple([number(), string(), boolean()])
// type ttt = Infer<typeof tt> // expected [number, string, boolean]

type Test1 = Expect<IsEqual<ttt, [number, string, boolean]>> // Should pass
// type Test1 = Expect<IsEqual<ttt, [number, string, boolean]>> // Should pass

export function func<
Args extends [Type<unknown>, ...Type<any>[]] | [],
Ret = Type,
T = (...args: TupleOutput<Args>) => Infer<Ret>,
>(args: Args, ret: Ret): Type<T> {
//
return {} as any
return generic('function', {
_check: v => isFunction(v),
})
}

const fn = func([string(), boolean(), int()], string()) // typeof fn should be: Type<(...args: [string, boolean]) => string>
// const fn = func([string(), boolean(), int()], string()) // typeof fn should be: Type<(...args: [string, boolean]) => string>

type typeFn = Infer<typeof fn> // typeFn should be: (...args: [string, boolean]) => string
// type typeFn = Infer<typeof fn> // typeFn should be: (...args: [string, boolean]) => string

type f1 = (a: number, b?: string) => boolean
type xx = Parameters<f1>
// type f1 = (a: number, b?: string) => boolean
// type xx = Parameters<f1>

0 comments on commit afcf847

Please sign in to comment.