is-char-suitable-for-html-attr-name
Version:
Is given character suitable to be in an HTML attribute's name?
11 lines (9 loc) • 997 B
JavaScript
/**
* @name is-char-suitable-for-html-attr-name
* @fileoverview Is given character suitable to be in an HTML attribute's name?
* @version 4.1.3
* @author Roy Revelt
* @license MIT
* {@link https://codsen.com/os/is-char-suitable-for-html-attr-name/}
*/
;var isCharSuitableForHtmlAttrName=(()=>{var n=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var c=(e,t)=>{for(var s in t)n(e,s,{get:t[s],enumerable:!0})},u=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of l(t))!a.call(e,r)&&r!==s&&n(e,r,{get:()=>t[r],enumerable:!(i=p(t,r))||i.enumerable});return e};var m=e=>u(n({},"__esModule",{value:!0}),e);var b={};c(b,{isAttrNameChar:()=>g,version:()=>h});var o="4.1.3";var h=o;function g(e){return typeof e=="string"&&(e.charCodeAt(0)>96&&e.charCodeAt(0)<123||e.charCodeAt(0)>64&&e.charCodeAt(0)<91||e.charCodeAt(0)>47&&e.charCodeAt(0)<58||e===":"||e==="-")}return m(b);})();