From 0de9c9ab5cb9ef736e9e5558345fb482189880b6 Mon Sep 17 00:00:00 2001 From: cexbrayat Date: Sat, 23 May 2020 17:07:53 +0200 Subject: [PATCH] chore(utils): proper typings Adds typings to utils, still in the quest for switching the TS config to `strict` Also removes the apparently unused utils method `isString` --- src/utils.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index e905db142..492f8cc03 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,8 +1,6 @@ import { GlobalMountOptions } from './types' - -const isString = (val: unknown): val is string => typeof val === 'string' - -function mergeStubs(target, source) { +import { AppConfig } from 'vue' +function mergeStubs(target: Record, source: GlobalMountOptions) { if (source.stubs) { if (Array.isArray(source.stubs)) { source.stubs.forEach((x) => (target[x] = true)) @@ -30,9 +28,12 @@ function mergeGlobalProperties( components: { ...configGlobal.components, ...mountGlobal.components }, provide: { ...configGlobal.provide, ...mountGlobal.provide }, mocks: { ...configGlobal.mocks, ...mountGlobal.mocks }, - config: { ...configGlobal.config, ...mountGlobal.config }, + config: { ...configGlobal.config, ...mountGlobal.config } as Omit< + AppConfig, + 'isNativeTag' + >, directives: { ...configGlobal.directives, ...mountGlobal.directives } } } -export { isString, mergeGlobalProperties } +export { mergeGlobalProperties }