Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Commit fe87726

Browse files
committed
Fixing exact type.
1 parent fe7980c commit fe87726

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/exact.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import type { Assert, Asserted } from './prelude.js'
1+
import type { Assert, Asserted, Primitive } from './prelude.js'
22
import { inspect } from 'util'
33
import object from './object.js'
44

55
const exact =
6-
<T extends Record<string, Assert<unknown>>>(kvs: T): Assert<{ [k in keyof T]: Asserted<T[k]> }> =>
6+
<T extends Record<string, Primitive | Assert<unknown>>>(kvs: T): Assert<{ [k in keyof T]: Asserted<T[k]> }> =>
77
value => {
88
if (typeof value !== 'object' || value === null) {
99
throw new TypeError(`Expected object, got ${inspect(value)}.`)

0 commit comments

Comments
 (0)