Struggling to describe a discriminated union with a Record field #1189
-
I'm trying to understand why this (simplified) example fails with rc.21 (it used to work with rc.12 or so): const schema = (type({
storeA: 'Record<string, string>',
}).or({
storeB: {
foo: 'Record<string, string>'
},
})).and({
ext: [ 'string', '=', '.txt' ]
});
const result = schema({
storeB: { foo: 'bar' }
});
if (result instanceof ArkErrors) {
throw new Error(result.summary);
}
console.log('passed'); The error is:
As a side note the error message would be probably a bit baffling to the end-user, especially in the |
Beta Was this translation helpful? Give feedback.
Answered by
ssalbdivad
Oct 30, 2024
Replies: 1 comment 1 reply
-
Yeah this is a bug I created an issue: It looks like I'm accidentally trying to apply |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
agladysh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah this is a bug I created an issue:
#1190
It looks like I'm accidentally trying to apply
pathToPropString
to the index signature when it's only meant to be applied to property keys.