/opt/canhelp/node_modules/node-domexception/.history
NameSizeModeActions
index_20210527203842.js00644editdlrm
index_20210527203947.js2620644editdlrm
index_20210527204259.js2790644editdlrm
index_20210527204418.js3050644editdlrm
index_20210527204756.js3840644editdlrm
index_20210527204833.js3950644editdlrm
index_20210527211208.js4460644editdlrm
index_20210527211248.js4480644editdlrm
index_20210527212722.js7800644editdlrm
index_20210527212731.js7800644editdlrm
index_20210527212746.js4480644editdlrm
index_20210527212900.js4740644editdlrm
index_20210527213022.js4970644editdlrm
index_20210527213822.js5000644editdlrm
index_20210527213843.js5080644editdlrm
index_20210527213852.js5100644editdlrm
index_20210527213910.js4610644editdlrm
index_20210527214034.js4610644editdlrm
index_20210527214643.js11890644editdlrm
index_20210527214654.js11890644editdlrm
index_20210527214700.js4610644editdlrm
package_20210527203733.json5370644editdlrm
package_20210527203825.json4780644editdlrm
package_20210527204621.json5210644editdlrm
package_20210527204913.json6330644editdlrm
package_20210527204925.json6330644editdlrm
package_20210527205145.json7160644editdlrm
package_20210527205156.json7160644editdlrm
README_20210527203617.md760644editdlrm
README_20210527212714.md16700644editdlrm
README_20210527213345.md15240644editdlrm
README_20210527213411.md15340644editdlrm
README_20210527213803.md16020644editdlrm
README_20210527214323.md16860644editdlrm
README_20210527214408.md16860644editdlrm
test_20210527205603.js00644editdlrm
test_20210527205957.js640644editdlrm
test_20210527210021.js630644editdlrm
Edit: /opt/canhelp/node_modules/node-domexception/.history/README_20210527214323.md (1686B)
# DOMException An implementation of the DOMException class from NodeJS This package exposes the [`DOMException`](https://developer.mozilla.org/en-US/docs/Web/API/DOMException) class that comes from NodeJS itself. (including all of the deprecated legacy codes) NodeJS has it built in, but it's not globally available, and you can't require/import it from somewhere. The only possible way is to use some web-ish tools that have been introduced into NodeJS that throws an error and catch the constructor. This way you will have the same class that NodeJS has and you can check if the error is a instance of DOMException. The instanceof check would not have worked with a custom class such as the DOMException provided by domenic which also is much larger in size since it has to re-construct the hole class from the ground up. (plz don't depend on this package in any other environment other than node >=10.5) ```js import DOMException from 'node-domexception' import { MessageChannel } from 'worker_threads' async function hello() { const port = new MessageChannel().port1 const ab = new ArrayBuffer() port.postMessage(ab, [ab, ab]) } hello().catch(err => { console.assert(err.name === 'DataCloneError') console.assert(err.code === 25) console.assert(err instanceof DOMException) }) 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) ```