Skip to content

Commit bb43704

Browse files
committed
chore: check string first in toDisplayString
1 parent 81a6708 commit bb43704

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/shared/src/toDisplayString.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import {
55
isFunction,
66
isPlainObject,
77
isSet,
8-
objectToString
8+
objectToString,
9+
isString
910
} from './index'
1011

1112
/**
1213
* For converting {{ interpolation }} values to displayed strings.
1314
* @private
1415
*/
1516
export const toDisplayString = (val: unknown): string => {
16-
return val == null
17+
return isString(val)
18+
? val
19+
: val == null
1720
? ''
1821
: isArray(val) ||
1922
(isObject(val) &&

0 commit comments

Comments
 (0)