validateOrThrow method
Validates node against typeName, throwing IPLDSchemaError with the
first precise error path when the node does not match.
Synchronous: never resolves links — see check.
Implementation
void validateOrThrow(String typeName, IPLDNode node) {
final result = check(typeName, node);
if (!result.isValid) {
throw IPLDSchemaError(
'Node does not match type "$typeName": ${result.errors.first}',
);
}
}