Skip to content

Commit a25b137

Browse files
committed
types: improve types
1 parent bc0ec27 commit a25b137

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/runtime-core/src/apiOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ export function applyOptions(
368368
function callSyncHook(
369369
name: 'beforeCreate' | 'created',
370370
options: ComponentOptions,
371-
ctx: any,
371+
ctx: ComponentPublicInstance,
372372
globalMixins: ComponentOptions[]
373373
) {
374374
callHookFromMixins(name, globalMixins, ctx)
@@ -389,7 +389,7 @@ function callSyncHook(
389389
function callHookFromMixins(
390390
name: 'beforeCreate' | 'created',
391391
mixins: ComponentOptions[],
392-
ctx: any
392+
ctx: ComponentPublicInstance
393393
) {
394394
for (let i = 0; i < mixins.length; i++) {
395395
const fn = mixins[i][name]

packages/shared/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ export const hasOwn = (
3333
): key is keyof typeof val => hasOwnProperty.call(val, key)
3434

3535
export const isArray = Array.isArray
36-
export const isFunction = (val: any): val is Function =>
36+
export const isFunction = (val: unknown): val is Function =>
3737
typeof val === 'function'
38-
export const isString = (val: any): val is string => typeof val === 'string'
39-
export const isSymbol = (val: any): val is symbol => typeof val === 'symbol'
40-
export const isObject = (val: any): val is Record<any, any> =>
38+
export const isString = (val: unknown): val is string => typeof val === 'string'
39+
export const isSymbol = (val: unknown): val is symbol => typeof val === 'symbol'
40+
export const isObject = (val: unknown): val is Record<any, any> =>
4141
val !== null && typeof val === 'object'
4242

43-
export function isPromise<T = any>(val: any): val is Promise<T> {
43+
export function isPromise<T = any>(val: unknown): val is Promise<T> {
4444
return isObject(val) && isFunction(val.then) && isFunction(val.catch)
4545
}
4646

4747
export const objectToString = Object.prototype.toString
4848
export const toTypeString = (value: unknown): string =>
4949
objectToString.call(value)
5050

51-
export const isPlainObject = (val: any): val is object =>
51+
export const isPlainObject = (val: unknown): val is object =>
5252
toTypeString(val) === '[object Object]'
5353

5454
export const isReservedProp = (key: string): boolean =>

0 commit comments

Comments
 (0)