https://github.com/mathiasbynens/is-potential-custom-element-name
Check whether a given string matches the `PotentialCustomElementName` production as defined in the HTML Standard.
https://github.com/mathiasbynens/is-potential-custom-element-name
Last synced: about 2 months ago
JSON representation
Check whether a given string matches the `PotentialCustomElementName` production as defined in the HTML Standard.
- Host: GitHub
- URL: https://github.com/mathiasbynens/is-potential-custom-element-name
- Owner: mathiasbynens
- License: mit
- Created: 2016-06-21T18:24:12.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-04-07T07:42:15.000Z (about 4 years ago)
- Last Synced: 2025-04-11T07:49:38.733Z (2 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 9
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT.txt
Awesome Lists containing this project
README
# is-potential-custom-element-name [](https://travis-ci.org/mathiasbynens/is-potential-custom-element-name)
_is-potential-custom-element-name_ checks whether a given string matches [the `PotentialCustomElementName` production](https://html.spec.whatwg.org/multipage/scripting.html#prod-potentialcustomelementname) as defined in the HTML Standard.
## Installation
To use _is-potential-custom-element-name_ programmatically, install it as a dependency via [npm](https://www.npmjs.com/):
```bash
$ npm install is-potential-custom-element-name
```Then, `require` it:
```js
const isPotentialCustomElementName = require('is-potential-custom-element-name');
```## Usage
```js
isPotentialCustomElementName('foo-bar');
// → true
isPotentialCustomElementName('Foo-bar');
// → false
isPotentialCustomElementName('baz-©');
// → false
isPotentialCustomElementName('annotation-xml');
// → true
```## Author
| [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](https://mathiasbynens.be/) |## License
_is-potential-custom-element-name_ is available under the [MIT](https://mths.be/mit) license.