2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-10 12:42:24 +03:00
Files
vue-meta/src/continuous-object-merge/remove.ts
T
2020-11-01 20:53:39 +01:00

13 lines
379 B
TypeScript

import { MetaContext, PathSegments } from '../types'
import { setByObject } from './set'
import { update } from './update'
export function remove (context: MetaContext, pathSegments?: PathSegments, key?: string) {
if (!key && (!pathSegments || !pathSegments.length)) {
setByObject(context, {})
return
}
update(context, pathSegments || [], key || '', undefined)
}