From 0fb17b195b461abb5562eb895feb6ce6574e06c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Tue, 6 May 2025 21:57:42 +0000 Subject: [PATCH] refactor(shared): re-export utilities from Vue --- packages/shared/utils/is.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/shared/utils/is.ts b/packages/shared/utils/is.ts index 3e485c593d3..326f99e3c0f 100644 --- a/packages/shared/utils/is.ts +++ b/packages/shared/utils/is.ts @@ -1,4 +1,6 @@ /* eslint-disable antfu/top-level-function */ +export { isPlainObject as isObject } from '@vue/shared' +export { NOOP as noop } from '@vue/shared' export const isClient = typeof window !== 'undefined' && typeof document !== 'undefined' export const isWorker = typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope export const isDef = (val?: T): val is T => typeof val !== 'undefined' @@ -7,13 +9,9 @@ export const assert = (condition: boolean, ...infos: any[]) => { if (!condition) console.warn(...infos) } -const toString = Object.prototype.toString -export const isObject = (val: any): val is object => - toString.call(val) === '[object Object]' export const now = () => Date.now() export const timestamp = () => +Date.now() export const clamp = (n: number, min: number, max: number) => Math.min(max, Math.max(min, n)) -export const noop = () => {} export const rand = (min: number, max: number) => { min = Math.ceil(min) max = Math.floor(max)