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)