import {isNil} from './lib/isnil.js';
import {_isArray} from './lib/array.js';
import {reduce} from './lib/reduce.js';

export * from './string';
export * from './util';
export * from './boolean';
export * from './number';
export * from './date';
export * from './creditCard';
export * from './ip';

export const validate =
  (...fn) =>
    value => {
      if (isNil(value)) {
        return false;
      }

      return reduce((acc, x) => {
        if (isNil(x)) {
          throw new Error('The function for validation is null or undefined.');
        } else {
          return acc && x(value);
        }
      }, true, fn);
    };

export const isValid =
  (v, r = []) => (validate(...(_isArray(r) ? r : [r]))(v));

@@ -317,16 +317,18 @@
 idate =%0A
+  
   (...fn
@@ -332,16 +332,20 @@
 .fn) =%3E%0A
+    
     valu
@@ -353,24 +353,30 @@
  =%3E %7B%0A      
+     
+ 
 if (isNil(va
@@ -379,24 +379,32 @@
 l(value)) %7B%0A
+        
         retu
@@ -423,11 +423,23 @@
     
+ 
-%7D%0A%0A
+     %7D%0A%0A      
     
@@ -464,24 +464,32 @@
 cc, x) =%3E %7B%0A
+        
         if (
@@ -510,16 +510,26 @@
         
+ 
+         
 throw ne
@@ -590,16 +590,24 @@
 ned.');%0A
+        
         
@@ -621,24 +621,34 @@
 %7B%0A          
+    
+      
 return acc &
@@ -667,18 +667,32 @@
         
-%7D%0A
+        %7D%0A      
       %7D,
@@ -734,16 +734,18 @@
 Valid =%0A
+  
   (v, r 

Add es6 to validate.js