source: frontend/node_modules/domexception/README.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.1 KB
Line 
1# DOMException
2
3This package implements the [`DOMException`](https://heycam.github.io/webidl/#idl-DOMException) class, from web browsers. It exists in service of [jsdom](https://github.com/tmpvar/jsdom) and related packages.
4
5Example usage:
6
7```js
8const DOMException = require("domexception");
9
10const e1 = new DOMException("Something went wrong", "BadThingsError");
11console.assert(e1.name === "BadThingsError");
12console.assert(e1.code === 0);
13
14const e2 = new DOMException("Another exciting error message", "NoModificationAllowedError");
15console.assert(e2.name === "NoModificationAllowedError");
16console.assert(e2.code === 7);
17
18console.assert(DOMException.INUSE_ATTRIBUTE_ERR === 10);
19```
20
21## APIs
22
23This package exposes two flavors of the `DOMException` interface depending on the imported module.
24
25### `domexception` module
26
27This module default-exports the `DOMException` interface constructor.
28
29### `domexception/webidl2js-wrapper` module
30
31This module exports the `DOMException` [interface wrapper API](https://github.com/jsdom/webidl2js#for-interfaces) generated by [webidl2js](https://github.com/jsdom/webidl2js).
Note: See TracBrowser for help on using the repository browser.