(value: mixed)
| 28 | } |
| 29 | |
| 30 | export function getToStringValue(value: mixed): ToStringValue { |
| 31 | switch (typeof value) { |
| 32 | case 'bigint': |
| 33 | case 'boolean': |
| 34 | case 'number': |
| 35 | case 'string': |
| 36 | case 'undefined': |
| 37 | return value; |
| 38 | case 'object': |
| 39 | if (__DEV__) { |
| 40 | checkFormFieldValueStringCoercion(value); |
| 41 | } |
| 42 | return value; |
| 43 | default: |
| 44 | // function, symbol are assigned as empty strings |
| 45 | return ''; |
| 46 | } |
| 47 | } |
no test coverage detected