Skip to content

Commit

Permalink
fix util version, optimize typePropOf
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalbdivad committed Sep 18, 2024
1 parent 51d67e5 commit 15463cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions ark/type/methods/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ interface Type<out t extends object = object, $ = {}>
props: array<typePropOf<t, $>>
}

type typePropOf<o, $> = {
[k in keyof o]-?: typeProp<o, k, $>
}[keyof o] &
unknown
type typePropOf<o, $> =
keyof o extends infer k ?
k extends keyof o ?
typeProp<o, k, $>
: never
: never

type typeProp<o, k extends keyof o, $, t = o[k] & ({} | null)> =
parseConstraints<t> extends (
Expand Down
2 changes: 1 addition & 1 deletion ark/util/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FileConstructor, objectKindOf } from "./objectKinds.ts"
// recent node versions (https://nodejs.org/api/esm.html#json-modules).

// For now, we assert this matches the package.json version via a unit test.
export const arkUtilVersion = "0.11.0"
export const arkUtilVersion = "0.12.0"

export const initialRegistryContents = {
version: arkUtilVersion,
Expand Down

0 comments on commit 15463cb

Please sign in to comment.