carlosingles / json-patch-query

Implementation of JSON Patch Query as proposed by the TM Forum
2 stars 0 forks source link

Add support for test operation #5

Closed madtisa closed 1 year ago

madtisa commented 1 year ago

Test patch operation hasn't seem to be supported

Steps to reproduce:

import patch from 'json-patch-query'

const item = { id: 342 }
console.log(patch.apply(item, [{ op: 'test', path: '$.id', value: 2 }]))

Expected behavior: Error, since id with such value is missing Actual behavior: Ignored operation

carlosingles commented 1 year ago

thanks for the report, the test operation has been added into the latest version v1.2.0 as per RFC6902