co.validation 2.6.1 → 2.6.2

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.
@@ -52,6 +52,13 @@ describe('createValidation', () => {
52
52
  data: 0,
53
53
  errors: undefined
54
54
  });
55
+ expect((0, _.createValidation)({
56
+ type: 'required',
57
+ getMessage: () => 'Required'
58
+ })(false)).toEqual({
59
+ data: false,
60
+ errors: undefined
61
+ });
55
62
  });
56
63
  it('supports custom', () => {
57
64
  const biggerThanX = (value, allValues) => {
package/lib/validators.js CHANGED
@@ -28,7 +28,7 @@ exports.custom = custom;
28
28
 
29
29
  const required = ({
30
30
  getMessage
31
- }) => value => value || typeof value === 'number' ? {
31
+ }) => value => value || typeof value === 'number' || typeof value === 'boolean' ? {
32
32
  data: value
33
33
  } : {
34
34
  errors: (0, _messageProcessor.default)(getMessage, '##required')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "co.validation",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
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": {