Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (name.indexOf('-') === -1) {
return 'Custom element names must contain a hyphen. Example: unicorn-cake';
}
if (/^\d/i.test(name)) {
return 'Custom element names must not start with a digit.';
}
if (/^-/i.test(name)) {
return 'Custom element names must not start with a hyphen.';
}
// http://www.w3.org/TR/custom-elements/#concepts
if (!ncname.test(name)) {
return 'Invalid element name.';
}
if (reservedNames.indexOf(name) !== -1) {
return 'The supplied element name is reserved and can\'t be used.\nSee: http://www.w3.org/TR/custom-elements/#concepts';
}
};
qnameCapture = (function() {
var ncname = require('ncname').source.slice(1, -1);
return '((?:' + ncname + '\\:)?' + ncname + ')';
})(),
startTagOpen = new RegExp('^<' + qnameCapture),
qnameCapture = (function() {
var ncname = require('ncname').source.slice(1, -1);
return '((?:' + ncname + '\\:)?' + ncname + ')';
})(),
startTagOpen = new RegExp('^<' + qnameCapture),