JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4957
  • Score
    100M100P100Q124942F
  • License MIT

Validate the name of a custom element

Package Exports

  • validate-element-name

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (validate-element-name) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

validate-element-name Build Status

Validate the name of a custom element

Install

$ npm install --save validate-element-name

Usage

var validate = require('validate-element-name');

try {
    validate('unicorn');
} catch (err) {
    console.log(err.message);
    //=> 'Custom element names must contain a hyphen. Example: unicorn-cake'
}

Throws an error if the custom element name is invalid.

License

MIT © Sindre Sorhus