Skip to content

Commit 1927627

Browse files
committed
[New] add EvalError and URIError
1 parent 060e1a5 commit 1927627

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ A simple cache for a few of the JS Error constructors.
1515
const assert = require('assert');
1616

1717
const Base = require('es-errors');
18+
const Eval = require('es-errors/eval');
1819
const Range = require('es-errors/range');
1920
const Ref = require('es-errors/ref');
2021
const Syntax = require('es-errors/syntax');
2122
const Type = require('es-errors/type');
23+
const URI = require('es-errors/uri');
2224

2325
assert.equal(Base, Error);
26+
assert.equal(Eval, EvalError);
2427
assert.equal(Range, RangeError);
2528
assert.equal(Ref, ReferenceError);
2629
assert.equal(Syntax, SyntaxError);
2730
assert.equal(Type, TypeError);
31+
assert.equal(URI, URIError);
2832
```
2933

3034
## Tests

eval.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare const EvalError: EvalErrorConstructor;
2+
3+
export = EvalError;

eval.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
'use strict';
2+
3+
/** @type {import('./eval')} */
4+
module.exports = EvalError;

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
"main": "index.js",
66
"exports": {
77
".": "./index.js",
8+
"./eval": "./eval.js",
89
"./range": "./range.js",
910
"./ref": "./ref.js",
1011
"./syntax": "./syntax.js",
1112
"./type": "./type.js",
13+
"./uri": "./uri.js",
1214
"./package.json": "./package.json"
1315
},
1416
"sideEffects": false,

uri.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare const URIError: URIErrorConstructor;
2+
3+
export = URIError;

uri.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
'use strict';
2+
3+
/** @type {import('./uri')} */
4+
module.exports = URIError;

0 commit comments

Comments
 (0)