co.validation 1.0.0-RC.6 → 1.0.0-RC.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,6 +71,20 @@ describe('createValidation', () => {
71
71
  }]);
72
72
  expect(validationResult.data).toEqual([]);
73
73
  });
74
+ it('list of numbers stays list of numbers', () => {
75
+ const validatedObject = [0, 1, 2];
76
+ const validationResult = (0, _.createValidation)({
77
+ type: 'array',
78
+ itemRule: {
79
+ type: 'all',
80
+ validators: [{
81
+ type: 'number'
82
+ }]
83
+ }
84
+ })(validatedObject);
85
+ expect(validationResult.errors).toEqual(undefined);
86
+ expect(validationResult.data).toEqual(validatedObject);
87
+ });
74
88
  it('single valid item stays in data', () => {
75
89
  const validatedObject = [{
76
90
  login: 'hey'
@@ -114,7 +114,7 @@ const createArrayValidation = rule => {
114
114
  resultErrors.push(null);
115
115
  }
116
116
 
117
- if (validationResult.data) {
117
+ if (validationResult.data !== null && validationResult.data !== undefined) {
118
118
  resultData.push(validationResult.data);
119
119
  }
120
120
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "co.validation",
3
- "version": "1.0.0-RC.6",
3
+ "version": "1.0.0-RC.7",
4
4
  "description": "JSON based fluent validation for browser, node.js, redux-form and anything javascript compatible.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "keywords": [
12
12
  "validation"
13
13
  ],
14
- "author": "collaboracia",
14
+ "author": "Collaboracia OÜ",
15
15
  "license": "ISC",
16
16
  "devDependencies": {
17
17
  "@babel/cli": "^7.4.4",