mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 18:31:53 +00:00
handle root document subscriptions
This commit is contained in:
@@ -25,6 +25,7 @@ export type Doc = { [key: string]: any }
|
||||
export type Operation = AddOperation<any> | RemoveOperation | ReplaceOperation<any>
|
||||
|
||||
export function getValueByPointer (document: any, pointer: string): any {
|
||||
if (pointer === '/') return document
|
||||
const pathArr = pointer.split('/')
|
||||
pathArr.shift()
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user