init
This commit is contained in:
commit
8c18398ae4
6 changed files with 111 additions and 0 deletions
13
lib/types.ts
Normal file
13
lib/types.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export type PairElts<A extends any[]> =
|
||||
A extends [] ? [] :
|
||||
A extends [infer _F] ? [] :
|
||||
A extends [infer _F, infer S, ...infer R] ? [S, ...PairElts<R>] :
|
||||
never;
|
||||
|
||||
export type StructOfArr<A extends string[], V> =
|
||||
// deno-lint-ignore ban-types
|
||||
A extends [] ? {} :
|
||||
A extends [infer K extends string, ...infer R extends string[]] ? { [key in K]: V } & StructOfArr<R, V> :
|
||||
never;
|
Loading…
Add table
Add a link
Reference in a new issue