function validateInput(name, input, validator, kind) {
  if (!validator) {
    return input;
  }
  const result = validator["~standard"].validate(input);
  if (result instanceof Promise) {
    throw new Error(
      `Async validators are not supported. ${titleCase(kind)} name ${name}`
    );
  }
  if (result.issues) {
    throw new Error(
      `Validation failed for ${kind} ${name}: ${result.issues.map((issue) => issue.message).join(", ")}`
    );
  }
  return result.value;
}
function titleCase(kind) {
  return kind.charAt(0).toUpperCase() + kind.slice(1);
}
export {
  validateInput
};
//# sourceMappingURL=validate-input.js.map
