I made a simple CLI tool to validate whether your custom element has a valid name https://github.com/sindresorhus/validate-element-name#cli … <sin-dre> is valid <sindre> is not
@sindresorhus Out of curiosity, why throw instead of just returning a boolean?
-
-
@mathias i need to return an error message when invalid. how would you do it? -
@sindresorhus@mathias validate('unicorn', function (err) { if (err) throw err.message // or whatever you want. }); - 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.