mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-10 12:42:24 +03:00
13 lines
379 B
TypeScript
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)
|
|
}
|