standard-objects-aggregateerror 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # `standard-objects-aggregateerror`
2
+ The standard built-in object `AggregateError` if it exists, otherwise `undefined`.
3
+
4
+ Part of the [Standard Objects](https://github.com/10xly/standard-objects) project.
5
+
6
+ ## Installation
7
+ ```bash
8
+ npm install standard-objects-aggregateerror
9
+ ```
10
+
11
+ ## Usage
12
+ ```javascript
13
+ const $AggregateError = require("standard-objects-aggregateerror")
14
+ const assert = require("assert")
15
+ assert($AggregateError === AggregateError)
16
+ ```
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export = AggregateError
package/index.js ADDED
@@ -0,0 +1,45 @@
1
+ var constant = require("lodash.constant")
2
+ var attempt = require("attempt-statement")
3
+ var noop = require("n0p3-es2015-cjs")
4
+
5
+ attempt(() => {
6
+ var _return = require("returndotjs/safe")._return
7
+ var functions = require("returndotjs/safe").functions
8
+ var $AggregateError = require("es-error-intrinsics/AggregateError")
9
+ var construct = require("construct-new")
10
+ var assert = require("assert-fn")
11
+ var { throwWhatever } = require("immediate-error")
12
+
13
+ functions.getAggregateError = function () {
14
+ attempt(() => {
15
+ attempt(() => {
16
+ throwWhatever(
17
+ construct({ target: $AggregateError, args: [["Hi"], "Hi"] })
18
+ )
19
+ })
20
+ .rescue((e) => {
21
+ assert(e instanceof $AggregateError)
22
+ assert(require("@10xly/strict-equals")(e.message, "Hi"))
23
+ })
24
+ .else((e) => {
25
+ assert(require("false-value")())
26
+ })
27
+ .ensure(noop)
28
+ .end()
29
+ _return($AggregateError)
30
+ })
31
+ .rescue((e) => {
32
+ _return()
33
+ })
34
+ .else(noop)
35
+ .ensure(noop)
36
+ .end()
37
+ }
38
+ module.__defineGetter__("exports", constant(functions.getAggregateError()))
39
+ })
40
+ .rescue(() => {
41
+ module.__defineGetter__("exports", constant())
42
+ })
43
+ .else(noop)
44
+ .ensure(noop)
45
+ .end()
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "standard-objects-aggregateerror",
3
+ "version": "1.0.0",
4
+ "description": "Standard built-in object AggregateError",
5
+ "keywords": [
6
+ "standard",
7
+ "objects"
8
+ ],
9
+ "homepage": "https://github.com/10xly/standard-objects#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/10xly/standard-objects/issues"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/10xly/standard-objects.git"
16
+ },
17
+ "license": "MIT",
18
+ "author": "10x'ly Made",
19
+ "type": "commonjs",
20
+ "main": "index.js",
21
+ "scripts": {
22
+ "test": "echo \"Error: no test specified\" && exit 1"
23
+ },
24
+ "dependencies": {
25
+ "@10xly/strict-equals": "^1.0.1",
26
+ "assert-fn": "^1.0.1",
27
+ "attempt-statement": "1.2.1",
28
+ "construct-new": "^2.0.5",
29
+ "es-error-intrinsics": "^1.0.1",
30
+ "false-value": "^2.0.6",
31
+ "immediate-error": "^12.0.0",
32
+ "lodash.constant": "3.0.0",
33
+ "n0p3-es2015-cjs": "1.0.1",
34
+ "returndotjs": "1.1.0"
35
+ }
36
+ }