1 |
|
2 |
|
3 |
|
4 | const bedrock = require('bedrock');
|
5 | const jsonPatch = require('./jsonPatch');
|
6 |
|
7 | const schema = {
|
8 | required: ['patch', 'sequence', 'target'],
|
9 | title: 'Sequence-based JSON Patch',
|
10 | type: 'object',
|
11 | properties: {
|
12 | target: {
|
13 | type: 'string',
|
14 | },
|
15 |
|
16 | patch: jsonPatch(),
|
17 | sequence: {
|
18 | type: 'integer',
|
19 | minimum: 0,
|
20 | maximum: Number.MAX_SAFE_INTEGER
|
21 | }
|
22 | },
|
23 | additionalProperties: false
|
24 | };
|
25 |
|
26 | module.exports = function(extend) {
|
27 | if(extend) {
|
28 | return bedrock.util.extend(true, bedrock.util.clone(schema), extend);
|
29 | }
|
30 | return schema;
|
31 | };
|