UNPKG

charcode-is-valid-xml-name-character

Version:

Does a given character belong to XML spec's "Production 4 OR 4a" type (is acceptable for XML element's name)

11 lines (9 loc) 1.07 kB
/** * @name charcode-is-valid-xml-name-character * @fileoverview Does a given character belong to XML spec's "Production 4 OR 4a" type (is acceptable for XML element's name) * @version 3.0.24 * @author Roy Revelt * @license MIT * {@link https://codsen.com/os/charcode-is-valid-xml-name-character/} */ import{isIndexWithin as o}from"ranges-is-index-within";var a=[[58,58],[65,90],[95,95],[192,214],[216,246],[248,767],[880,893],[895,8191],[8204,8205],[8304,8591],[11264,12271],[12289,55295],[63744,64975],[65008,65533],[65536,983039]],s=[[45,45],[46,46],[48,57],[58,58],[65,90],[95,95],[183,183],[192,214],[216,246],[248,767],[768,879],[880,893],[895,8191],[8204,8205],[8255,8256],[8304,8591],[11264,12271],[12289,55295],[63744,64975],[65008,65533],[65536,983039]],t=[[97,122]],e={inclusiveRangeEnds:!0,skipIncomingRangeSorting:!0};function i(n){return o(n.codePointAt(0),t,e)||o(n.codePointAt(0),a,e)}function c(n){return o(n.codePointAt(0),t,e)||o(n.codePointAt(0),s,e)}export{i as isProduction4,c as isProduction4a,i as validFirstChar,c as validSecondCharOnwards};