Add lbry.nameIsValid()

This commit is contained in:
Alex Liebowitz 2016-11-18 04:00:03 -05:00
parent aea1c7e6ee
commit 5af7916b20

View file

@ -333,6 +333,11 @@ lbry.formatName = function(name) {
return name; return name;
} }
lbry.nameIsValid = function(name, checkCase=true) {
const regexp = new RegExp('^[a-z0-9-]+$', checkCase ? '' : 'i');
return regexp.test(name);
}
lbry.loadJs = function(src, type, onload) lbry.loadJs = function(src, type, onload)
{ {
var lbryScriptTag = document.getElementById('lbry'), var lbryScriptTag = document.getElementById('lbry'),