diff --git a/package.json b/package.json index 6807257..97d7215 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "zeed", "type": "module", - "version": "0.24.7", + "version": "0.24.8", "description": "🌱 Simple foundation library", "author": { "name": "Dirk Holtwick", diff --git a/src/common/schema/schema.ts b/src/common/schema/schema.ts index 603069b..74fde93 100644 --- a/src/common/schema/schema.ts +++ b/src/common/schema/schema.ts @@ -1,5 +1,4 @@ import { first, isBoolean, isFunction, isInteger, isNumber, isObject, isString } from '../data' -import type { Expect, IsEqual } from './test' export interface TypeProps { } @@ -214,23 +213,24 @@ export function tuple(items: T): ArrayType // expected [number, string, boolean] +// const tt = tuple([number(), string(), boolean()]) +// type ttt = Infer // expected [number, string, boolean] -type Test1 = Expect> // Should pass +// type Test1 = Expect> // Should pass export function func< Args extends [Type, ...Type[]] | [], Ret = Type, T = (...args: TupleOutput) => Infer, >(args: Args, ret: Ret): Type { - // - 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 // typeFn should be: (...args: [string, boolean]) => string +// type typeFn = Infer // typeFn should be: (...args: [string, boolean]) => string -type f1 = (a: number, b?: string) => boolean -type xx = Parameters +// type f1 = (a: number, b?: string) => boolean +// type xx = Parameters