UNPKG

533 BJavaScriptView Raw
1/**
2 * Copyright (c) 2015-present, Facebook, Inc.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 *
8 */
9import { coerceValue } from './coerceValue';
10
11/**
12 * Deprecated. Use coerceValue() directly for richer information.
13 *
14 * This function will be removed in v15
15 */
16export function isValidJSValue(value, type) {
17 var errors = coerceValue(value, type).errors;
18 return errors ? errors.map(function (error) {
19 return error.message;
20 }) : [];
21}
\No newline at end of file