isValidJSValue.js 510 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.isValidJSValue = isValidJSValue;
  6. var _coerceValue = require("./coerceValue");
  7. /* istanbul ignore file */
  8. /**
  9. * Deprecated. Use coerceInputValue() directly for richer information.
  10. *
  11. * This function will be removed in v15
  12. */
  13. function isValidJSValue(value, type) {
  14. var errors = (0, _coerceValue.coerceValue)(value, type).errors;
  15. return errors ? errors.map(function (error) {
  16. return error.message;
  17. }) : [];
  18. }