Commit 35e94f5977ac9c3edd6e8f9b9a8bc5c33a572162
Rename error functions for clarity
Piet Geursen committed on 3/16/2018, 2:42:57 AMParent: 3cbada945feb3478fdc1fe814b9eb9edaab26763
Files changed
errors/sync/isPositionChoiceError.js | changed |
errors/sync/isPositionLateError.js | changed |
errors/sync/isPositionTypeError.js | changed |
errors/sync/isPostionError.js | changed |
errors/sync/isPositionChoiceError.js | ||
---|---|---|
@@ -1,12 +1,12 @@ | ||
1 | 1 | const Validator = require('is-my-json-valid') |
2 | 2 | const schema = require('../schema/positionChoiceError') |
3 | 3 | const validator = Validator(schema, {verbose: true}) |
4 | 4 | |
5 | -module.exports = function isError (obj) { | |
5 | +module.exports = function isPositionChoiceError (obj) { | |
6 | 6 | const result = validator(obj) |
7 | 7 | |
8 | 8 | // exposes error messages provided by is-my-json-valid |
9 | - isError.errors = validator.errors | |
9 | + isPositionChoiceError.errors = validator.errors | |
10 | 10 | |
11 | 11 | return result |
12 | 12 | } |
errors/sync/isPositionLateError.js | ||
---|---|---|
@@ -2,12 +2,12 @@ | ||
2 | 2 | const schema = require('../schema/positionLateError') |
3 | 3 | const validator = Validator(schema, {verbose: true}) |
4 | 4 | |
5 | 5 | // server is not used here. Closure pattern is just for consistency of use with other functions. |
6 | -module.exports = function isError (obj) { | |
6 | +module.exports = function isPositionLateError (obj) { | |
7 | 7 | const result = validator(obj) |
8 | 8 | |
9 | 9 | // exposes error messages provided by is-my-json-valid |
10 | - isError.errors = validator.errors | |
10 | + isPositionLateError.errors = validator.errors | |
11 | 11 | |
12 | 12 | return result |
13 | 13 | } |
errors/sync/isPositionTypeError.js | ||
---|---|---|
@@ -2,12 +2,12 @@ | ||
2 | 2 | const schema = require('../schema/positionTypeError') |
3 | 3 | const validator = Validator(schema, {verbose: true}) |
4 | 4 | |
5 | 5 | // server is not used here. Closure pattern is just for consistency of use with other functions. |
6 | -module.exports = function isError (obj) { | |
6 | +module.exports = function isPostitionTypeError (obj) { | |
7 | 7 | const result = validator(obj) |
8 | 8 | |
9 | 9 | // exposes error messages provided by is-my-json-valid |
10 | - isError.errors = validator.errors | |
10 | + isPostitionTypeError.errors = validator.errors | |
11 | 11 | |
12 | 12 | return result |
13 | 13 | } |
errors/sync/isPostionError.js | ||
---|---|---|
@@ -2,12 +2,12 @@ | ||
2 | 2 | const schema = require('../schema/postionError') |
3 | 3 | const validator = Validator(schema, {verbose: true}) |
4 | 4 | |
5 | 5 | // server is not used here. Closure pattern is just for consistency of use with other functions. |
6 | -module.exports = function isError (obj) { | |
6 | +module.exports = function isPositionError (obj) { | |
7 | 7 | const result = validator(obj) |
8 | 8 | |
9 | 9 | // exposes error messages provided by is-my-json-valid |
10 | - isError.errors = validator.errors | |
10 | + isPositionError.errors = validator.errors | |
11 | 11 | |
12 | 12 | return result |
13 | 13 | } |
Built with git-ssb-web