isValidJSValue.mjs 376 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/* istanbul ignore file */
import { coerceValue } from './coerceValue';
/**
 * Deprecated. Use coerceInputValue() directly for richer information.
 *
 * This function will be removed in v15
 */

export function isValidJSValue(value, type) {
  var errors = coerceValue(value, type).errors;
  return errors ? errors.map(function (error) {
    return error.message;
  }) : [];
}