Update client/lib/json-patch-lib.ts

This commit is contained in:
Lucy C
2022-10-03 10:45:46 -06:00
committed by GitHub
parent feb5c428db
commit c4bfb278ac

View File

@@ -48,6 +48,7 @@ export function arrayFromPath(path: string): string[] {
.split('/') .split('/')
.slice(1) .slice(1)
.map(p => .map(p =>
// order matters, always replace "~1" first
p.replace(new RegExp('~1', 'g'), '/').replace(new RegExp('~0', 'g'), '~'), p.replace(new RegExp('~1', 'g'), '/').replace(new RegExp('~0', 'g'), '~'),
) )
} }