From dd087886dd182089cdf6ed71ab658868f45f322c Mon Sep 17 00:00:00 2001 From: Dirk Holtwick Date: Mon, 26 Aug 2024 23:34:57 +0200 Subject: [PATCH 1/2] fix: tree shake --- src/common/schema/schema.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 From 5f280d67293808b61a1902e3febf3f6daedc6864 Mon Sep 17 00:00:00 2001 From: Dirk Holtwick Date: Mon, 26 Aug 2024 23:35:03 +0200 Subject: [PATCH 2/2] 0.24.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",