Skip to content

Commit 202532c

Browse files
committed
chore: use consistent signature for shared utilities
1 parent 0c1fe72 commit 202532c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/shared/src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ export const isSymbol = (val: unknown): val is symbol => typeof val === 'symbol'
5050
export const isObject = (val: unknown): val is Record<any, any> =>
5151
val !== null && typeof val === 'object'
5252

53-
export function isPromise<T = any>(val: unknown): val is Promise<T> {
53+
export const isPromise = <T = any>(val: unknown): val is Promise<T> => {
5454
return isObject(val) && isFunction(val.then) && isFunction(val.catch)
5555
}
5656

5757
export const objectToString = Object.prototype.toString
5858
export const toTypeString = (value: unknown): string =>
5959
objectToString.call(value)
6060

61-
export function toRawType(value: unknown): string {
61+
export const toRawType = (value: unknown): string => {
6262
return toTypeString(value).slice(8, -1)
6363
}
6464

@@ -72,7 +72,7 @@ export const isReservedProp = /*#__PURE__*/ makeMap(
7272
'onVnodeBeforeUnmount,onVnodeUnmounted'
7373
)
7474

75-
function cacheStringFunction<T extends (str: string) => string>(fn: T): T {
75+
const cacheStringFunction = <T extends (str: string) => string>(fn: T): T => {
7676
const cache: Record<string, string> = Object.create(null)
7777
return ((str: string) => {
7878
const hit = cache[str]
@@ -105,7 +105,7 @@ export const hasChanged = (value: any, oldValue: any): boolean =>
105105
value !== oldValue && (value === value || oldValue === oldValue)
106106

107107
// for converting {{ interpolation }} values to displayed strings.
108-
export function toDisplayString(val: unknown): string {
108+
export const toDisplayString = (val: unknown): string => {
109109
return val == null
110110
? ''
111111
: isArray(val) || (isPlainObject(val) && val.toString === objectToString)

0 commit comments

Comments
 (0)