Mixing `partial` and `type` negates effects of `partial`
hgezim opened this issue · comments
Gezim Hoxha commented
Seems to me this test should work:
import { partial, string, number, type } from '../../../src'
export const Struct = partial(type({
name: string(),
age: number(),
}))
export const data = {
name: 'john',
c: 'doe'
}
export const output = {
name: 'john',
c: 'doe'
}
But it throws:
1) superstruct
validation
partial
valid-partial-type:
Error: Expected "valid-partial-type" fixture not to throw an error but it did:
StructError: At path: c -- Expected a value of type `never`, but received: `"doe"`
at Context.<anonymous> (test/index.ts:64:23)
at processImmediate (node:internal/timers:476:21)
Daniel Lindenkreuz commented
Already reported here: #829
Artur Müller commented
This has been resolved in #1149