is-valid-element-name

Validates custom element names according to the custom elements spec

BSD-2-Clause 1 个版本
安装
npm install is-valid-element-name
yarn add is-valid-element-name
pnpm add is-valid-element-name
bun add is-valid-element-name
README

is-valid-element-name

Build Status npm version

Determines if an string is a valid element name. Like validate-element-name but without opinions on what a custom element name should be.

Backed by is-potential-custom-element-name which does the heavy lifting, but also checks against reserved names.

Install

npm install is-valid-element-name --save

Use

var isValidElementName = require("is-valid-element-name");

isValidElementName("hello-world"); // -> true
isValidElementName("div"); // -> false
isValidElementName("f0_0_0-what"); // -> true

// This is a reserved name.
isvalidElementName("font-face"); // -> false

License

BSD 2 Clause

版本列表
1.0.0 2016-06-22