From 78ebcb15d5b7cb59e5ce5a7f4b5382809046f537 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 7 Nov 2023 09:18:55 +0800 Subject: [PATCH] fix: utils --- src/utils/index.ts | 8 +++++--- src/utils/is.ts | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 31b2f93..421d5db 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,6 +1,5 @@ import type { RouteLocationNormalized, RouteRecordNormalized } from 'vue-router' import type { App, Component } from 'vue' - import { intersectionWith, isEqual, mergeWith, unionWith } from 'lodash-es' import { unref } from 'vue' import { isArray, isObject } from '@/utils/is' @@ -80,7 +79,10 @@ export function deepMerge = T & { export type CustomComponent = Component & { displayName?: string } export function withInstall(component: T, alias?: string) { - ;(component as Record).install = (app: App) => { + (component as Record).install = (app: App) => { const compName = component.name || component.displayName if (!compName) return diff --git a/src/utils/is.ts b/src/utils/is.ts index c3147e6..15946c7 100644 --- a/src/utils/is.ts +++ b/src/utils/is.ts @@ -66,7 +66,7 @@ export function isString(val: unknown): val is string { return is(val, 'String') } -export function isFunction(val: unknown): val is Fn { +export function isFunction(val: unknown): val is Function { return typeof val === 'function' } @@ -99,6 +99,6 @@ export const isServer = typeof window === 'undefined' export const isClient = !isServer export function isUrl(path: string): boolean { - const reg = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/ + const reg = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/ return reg.test(path) }