chore: check string first in toDisplayString
This commit is contained in:
parent
81a6708739
commit
bb43704b64
@ -5,7 +5,8 @@ import {
|
|||||||
isFunction,
|
isFunction,
|
||||||
isPlainObject,
|
isPlainObject,
|
||||||
isSet,
|
isSet,
|
||||||
objectToString
|
objectToString,
|
||||||
|
isString
|
||||||
} from './index'
|
} from './index'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -13,7 +14,9 @@ import {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export const toDisplayString = (val: unknown): string => {
|
export const toDisplayString = (val: unknown): string => {
|
||||||
return val == null
|
return isString(val)
|
||||||
|
? val
|
||||||
|
: val == null
|
||||||
? ''
|
? ''
|
||||||
: isArray(val) ||
|
: isArray(val) ||
|
||||||
(isObject(val) &&
|
(isObject(val) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user