1 | 'use strict';
|
2 | var Validate = require('./Validate')
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | var ValidateHelpers = function(path,value){
|
10 | this.path = path
|
11 | this.value = value
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | ValidateHelpers.prototype.path = null
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | ValidateHelpers.prototype.value = null
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | ValidateHelpers.prototype.drop = function(message){
|
28 | throw new Validate('drop',message,this.path,this.value)
|
29 | }
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | ValidateHelpers.prototype.reject = function(message){
|
35 | throw new Validate('reject',message,this.path,this.value)
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | ValidateHelpers.prototype.warn = function(message,value){
|
43 | throw new Validate('warn',message,this.path,value)
|
44 | }
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | ValidateHelpers.prototype.error = function(message){
|
50 | throw new Validate('error',message,this.path,this.value)
|
51 | }
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | ValidateHelpers.prototype.ok = function(value){
|
57 | throw new Validate('ok',null,this.path,value)
|
58 | }
|
59 |
|
60 | module.exports = exports = ValidateHelpers |
\ | No newline at end of file |