import { get, set } from 'lodash-unified'; import type { Entries } from 'type-fest'; import type { Arrayable } from '.'; export const keysOf = (arr: T) => Object.keys(arr) as Array; export const entriesOf = (arr: T) => Object.entries(arr) as Entries; export { hasOwn } from '@vue/shared'; export const getProp = ( obj: Record, path: Arrayable, defaultValue?: any, ): { value: T } => { return { get value() { return get(obj, path, defaultValue); }, set value(val: any) { set(obj, path, val); }, }; };