JSPM

  • Created
  • Published
  • Downloads 460
  • Score
    100M100P100Q91429F
  • License MIT

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

Package Exports

  • charcode-is-valid-xml-name-character

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 (charcode-is-valid-xml-name-character) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

charcode-is-valid-xml-name-character

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

Install

npm i charcode-is-valid-xml-name-character

Quick Take

import { strict as assert } from "assert";
import {
  isProduction4,
  isProduction4a,
  validFirstChar,
  validSecondCharOnwards,
} from "charcode-is-valid-xml-name-character";

// Spec: https://www.w3.org/TR/REC-xml/#NT-NameStartChar

assert.equal(isProduction4("Z"), true);
assert.equal(isProduction4("?"), false);

assert.equal(isProduction4a("?"), false);
assert.equal(isProduction4a("-"), true);

assert.equal(validFirstChar("a"), true);
assert.equal(validFirstChar("1"), false);

assert.equal(validSecondCharOnwards("a"), true);
assert.equal(validSecondCharOnwards("?"), false);

Documentation

Please visit codsen.com for a full description of the API and examples.

Contributing

To report bugs or request features or assistance, raise an issue on GitHub.

Licence

MIT License

Copyright (c) 2010-2021 Roy Revelt and other contributors

ok codsen star