@platformparity/dom-exception

1.0.0-wip.5 • Public • Published

DOM Exception

This package implements the DOMException class, from web browsers. It exists in service of jsdom and related packages.

Example usage:

const { DOMException } = require("@platformparity/dom-exception");

const e1 = new DOMException("Something went wrong", "BadThingsError");
console.assert(e1.name === "BadThingsError");
console.assert(e1.code === 0);

const e2 = new DOMException("Another exciting error message", "NoModificationAllowedError");
console.assert(e2.name === "NoModificationAllowedError");
console.assert(e2.code === 7);

console.assert(DOMException.INUSE_ATTRIBUTE_ERR === 10);

Package Sidebar

Install

npm i @platformparity/dom-exception

Weekly Downloads

13

Version

1.0.0-wip.5

License

MIT

Unpacked Size

15 kB

Total Files

8

Last publish

Collaborators

  • qwtel