Skip to content

Commit

Permalink
remove type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkulpinski committed Apr 12, 2024
1 parent b55a869 commit 36a426c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@curiousleaf/utils",
"description": "A lightweight set of utilities",
"version": "1.0.23",
"version": "1.0.24",
"license": "MIT",
"type": "module",
"author": {
Expand Down
23 changes: 0 additions & 23 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,3 @@ export * from "./params/params"
export * from "./parsers/parsers"
export * from "./random/random"
export * from "./time/time"

export type WithOptional<Type, Key extends keyof Type> = Pick<Partial<Type>, Key> & Omit<Type, Key>
export type WithRequired<Type, Key extends keyof Type> = Type & { [Prop in Key]-?: Type[Prop] }

export type DeepIdx<T, K extends string> = K extends ""
? T
: K extends keyof T
? T[K]
: K extends `${infer K0}.${infer KR}`
? K0 extends keyof T
? DeepIdx<T[K0], KR>
: never
: never

export type ValidatePath<T, K extends string> = K extends ""
? ""
: K extends keyof T
? K
: K extends `${infer K0}.${infer KR}`
? K0 extends keyof T
? `${K0}.${ValidatePath<T[K0], KR>}`
: Extract<keyof T, string>
: Extract<keyof T, string>

0 comments on commit 36a426c

Please sign in to comment.