|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | # is-potential-custom-element-name [](https://travis-ci.org/mathiasbynens/is-potential-custom-element-name)
|
|---|
| 2 |
|
|---|
| 3 | _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.
|
|---|
| 4 |
|
|---|
| 5 | ## Installation
|
|---|
| 6 |
|
|---|
| 7 | To use _is-potential-custom-element-name_ programmatically, install it as a dependency via [npm](https://www.npmjs.com/):
|
|---|
| 8 |
|
|---|
| 9 | ```bash
|
|---|
| 10 | $ npm install is-potential-custom-element-name
|
|---|
| 11 | ```
|
|---|
| 12 |
|
|---|
| 13 | Then, `require` it:
|
|---|
| 14 |
|
|---|
| 15 | ```js
|
|---|
| 16 | const isPotentialCustomElementName = require('is-potential-custom-element-name');
|
|---|
| 17 | ```
|
|---|
| 18 |
|
|---|
| 19 | ## Usage
|
|---|
| 20 |
|
|---|
| 21 | ```js
|
|---|
| 22 | isPotentialCustomElementName('foo-bar');
|
|---|
| 23 | // → true
|
|---|
| 24 | isPotentialCustomElementName('Foo-bar');
|
|---|
| 25 | // → false
|
|---|
| 26 | isPotentialCustomElementName('baz-©');
|
|---|
| 27 | // → false
|
|---|
| 28 | isPotentialCustomElementName('annotation-xml');
|
|---|
| 29 | // → true
|
|---|
| 30 | ```
|
|---|
| 31 |
|
|---|
| 32 | ## Author
|
|---|
| 33 |
|
|---|
| 34 | | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
|---|
| 35 | |---|
|
|---|
| 36 | | [Mathias Bynens](https://mathiasbynens.be/) |
|
|---|
| 37 |
|
|---|
| 38 | ## License
|
|---|
| 39 |
|
|---|
| 40 | _is-potential-custom-element-name_ is available under the [MIT](https://mths.be/mit) license.
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.