Skip to content

Commit

Permalink
code: remove unused type
Browse files Browse the repository at this point in the history
  • Loading branch information
gvergnaud committed Sep 22, 2024
1 parent e9c9ee8 commit c5778f3
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/types/BuildMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,6 @@ type BuildOne<data, xs extends readonly any[]> = xs extends [
? BuildOne<SetDeep<data, value, path>, tail>
: data;

// GetDeep :: a -> PropertyKey[] -> b
export type GetDeep<data, path> = path extends readonly [
infer head,
...infer tail
]
? data extends readonly any[]
? data extends readonly [any, ...any]
? head extends number
? GetDeep<data[head], tail>
: never
: GetDeep<ValueOf<data>, tail>
: data extends Set<infer a>
? GetDeep<a, tail>
: data extends Map<any, infer v>
? GetDeep<v, tail>
: head extends keyof data
? GetDeep<data[head], tail>
: never
: data;

// SetDeep :: a -> b -> PropertyKey[] -> a
export type SetDeep<data, value, path> = path extends readonly [
infer head,
Expand Down

0 comments on commit c5778f3

Please sign in to comment.