isValidJSValue.mjs 376 B

1234567891011121314
  1. /* istanbul ignore file */
  2. import { coerceValue } from './coerceValue';
  3. /**
  4. * Deprecated. Use coerceInputValue() directly for richer information.
  5. *
  6. * This function will be removed in v15
  7. */
  8. export function isValidJSValue(value, type) {
  9. var errors = coerceValue(value, type).errors;
  10. return errors ? errors.map(function (error) {
  11. return error.message;
  12. }) : [];
  13. }