Skip to content

Instantly share code, notes, and snippets.

@calderaro
Last active September 25, 2015 21:59
Show Gist options
  • Save calderaro/58121f8f8d64399fe72e to your computer and use it in GitHub Desktop.
Save calderaro/58121f8f8d64399fe72e to your computer and use it in GitHub Desktop.
validations
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