Runs a schema synchronously and returns the typed result.
The one place the framework calls a validator, so it is the one place that
has to hold the sync-only line. The spec permits validate to return a
promise, and the spec's own FAQ tells sync-only consumers to detect that and
throw — which is what happens here. Without it an async validator's promise
was treated as a successful result, and every read silently returned
undefined while reporting success.
Runs a schema synchronously and returns the typed result.
The one place the framework calls a validator, so it is the one place that has to hold the sync-only line. The spec permits
validateto return a promise, and the spec's own FAQ tells sync-only consumers to detect that and throw — which is what happens here. Without it an async validator's promise was treated as a successful result, and every read silently returnedundefinedwhile reporting success.