Add lbry.nameIsValid()
This commit is contained in:
parent
aea1c7e6ee
commit
5af7916b20
1 changed files with 5 additions and 0 deletions
|
@ -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'),
|
||||||
|
|
Loading…
Reference in a new issue