Commit 7520a969a39fb3590cb018c3ce4a61457ba569bc
Wip
Piet Geursen committed on 3/8/2018, 3:25:15 AMParent: ac1a79fec1e45652d23a6905c8540851a850a868
Files changed
types.js | ||
---|---|---|
@@ -1,9 +1,9 @@ | ||
1 | 1 | module.exports = { |
2 | 2 | CHOOSE_ONE: 'chooseOne', |
3 | 3 | ERROR_POSITION_TYPE: 'ERROR_POSITION_TYPE', |
4 | 4 | ERROR_POSITION_LATE: 'ERROR_POSITION_LATE', |
5 | - ERROR_POSTITION_CHOICE: 'ERROR_POSTITION_CHOICE' | |
5 | + ERROR_POSITION_CHOICE: 'ERROR_POSITION_CHOICE' | |
6 | 6 | } |
7 | 7 | |
8 | 8 | // Question: do these need to be different, could we just have 'chooseOne', |
9 | 9 | // because we already have: |
errors/schema/error.js | ||
---|---|---|
@@ -1,0 +1,40 @@ | ||
1 | +const { ERROR_POSITION_CHOICE, ERROR_POSITION_TYPE, ERROR_POSITION_LATE } = require('../../types') | |
2 | + | |
3 | +var schema = { | |
4 | + type: 'object', | |
5 | + required: ['type', 'position', 'message'], | |
6 | + properties: { | |
7 | + type: { | |
8 | + type: 'string', | |
9 | + oneOf: [ | |
10 | + { | |
11 | + type: 'string', | |
12 | + pattern: `^${ERROR_POSITION_CHOICE}$` | |
13 | + | |
14 | + }, | |
15 | + { | |
16 | + | |
17 | + }, | |
18 | + { | |
19 | + | |
20 | + }, | |
21 | + ERROR_POSITION_CHOICE, | |
22 | + ERROR_POSITION_TYPE, | |
23 | + ERROR_POSITION_LATE | |
24 | + ] | |
25 | + }, | |
26 | + position: { | |
27 | + type: 'object' | |
28 | + }, | |
29 | + message: { | |
30 | + type: 'string' | |
31 | + }, | |
32 | + definitions: { | |
33 | + errorTypePatterns: { | |
34 | + | |
35 | + } | |
36 | + } | |
37 | + } | |
38 | +} | |
39 | + | |
40 | +module.exports = schema |
errors/sync/error.js |
---|
errors/sync/isError.js |
---|
errors/sync/isPositionChoiceError.js |
---|
errors/sync/isPositionLateError.js |
---|
errors/sync/isPositionTypeError.js |
---|
errors/sync/positionChoiceError.js |
---|
errors/sync/positionLateError.js |
---|
errors/sync/positionTypeError.js |
---|
Built with git-ssb-web