Last active
September 25, 2015 21:59
-
-
Save calderaro/58121f8f8d64399fe72e to your computer and use it in GitHub Desktop.
validations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isDup = function (a){ | |
return a.length !== R.uniq(a).length | |
} | |
var isEmpty = function (a){ | |
return R.length(a) ? false : true | |
} | |
//valid | |
R.filter(R.test(/[\w]{5,30}/), serials); | |
var isValid = function(regex, serials, cb){ | |
let filtered = R.filter(R.test(regex), serials) | |
return serials.length === filtered.length ? cb(null) : cb("Seriales invalidos " + R.difference(serials, filtered)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment