UNPKG

maz-ui

Version:

A standalone components library for Vue.Js 3 & Nuxt.Js 3

9 lines (8 loc) 290 B
import { toValue } from "vue"; function useFreezeValue(value) { const rawValue = toValue(value); return Array.isArray(rawValue) ? Object.freeze([...rawValue]) : typeof rawValue == "object" && rawValue !== null ? Object.freeze({ ...rawValue }) : rawValue; } export { useFreezeValue };