@platformparity/dom-exception
v1.0.0-wip.5
Published
An implementation of the DOMException class from browsers
Downloads
19
Maintainers
Readme
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);