-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
According to the specification the following schema is supposed match { foo: 'foo' } and any item that is not an object to begin with.
{
"properties": {
"foo": { "const": "foo" }
}
}
In a similar manner the following schema is supposed to match the tuple [ 'bar', 123 ] and any item that is not an array at all.
{
"items": [
{ "const": "bar" },
{ "const": 123 }
]
}
Iotsfjs currently fails to validate these requirements because I haven't been able to find a good way to describe them in the TypeScript's static type system. Essentially they could be described with somethings like { foo: 'foo' } | Not<Record<string, any>> and ['bar', 123] | Not<Array<any>> but TypeScript doesn't provide Not out of box. It might be possible to represent them with conditional types but this gets quite complicated very easily.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels