MCPcopy Create free account
hub / github.com/Starcounter-Jack/JSON-Patch / validator

Function validator

test/spec/validateSpec.mjs:499–507  ·  view source on GitHub ↗
(operation, index, tree, existingPath)

Source from the content-addressed store, hash-verified

497
498
499 const validator = function(operation, index, tree, existingPath) {
500 throw new jsonpatch.JsonPatchError(
501 'Operation `value` property must not contain the old value',
502 'OPERATION_VALUE_MUST_NOT_CONTAIN_OLD_VALUE',
503 index,
504 operation,
505 tree
506 );
507 }
508 const customError = jsonpatch.validate(sequence, tree, validator);
509 expect(customError.index).toBe(0);
510 expect(customError.name).toBe('OPERATION_VALUE_MUST_NOT_CONTAIN_OLD_VALUE');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected