immediate-error 12.2.3 → 12.2.5
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/.github/workflows/smoke.yml +10 -0
- package/index.js +21 -16
- package/package.json +5 -4
package/index.js
CHANGED
|
@@ -27,7 +27,7 @@ const NEWLINE = require("fizzbuzz-enterprise/source/main/constants/strings/delim
|
|
|
27
27
|
const emptyString = require("empty-string")
|
|
28
28
|
const falseValue = require("false-value"),
|
|
29
29
|
sleep = require("@redux-saga/delay-p").default
|
|
30
|
-
const uncurry = require("
|
|
30
|
+
const uncurry = require("call-bind-enterprise")
|
|
31
31
|
const join = require("array.prototype.join")
|
|
32
32
|
const at = require("string.prototype.at")
|
|
33
33
|
const replaceAll = require("str-replaceallof-es")
|
|
@@ -79,6 +79,9 @@ const isUndefined = require("@is-(unknown)/is-undefined")
|
|
|
79
79
|
// eslint-disable-next-line sonarjs/no-globals-shadowing
|
|
80
80
|
const isNaN = require("@is-(unknown)/is-nan")
|
|
81
81
|
const use = require("use-unused-vars")
|
|
82
|
+
const assign = require("@frosted/object.assign")
|
|
83
|
+
const global = require("@10xly/global")
|
|
84
|
+
const getFnName = require("name-of-function")
|
|
82
85
|
|
|
83
86
|
const { TernaryCompare } = require("important-extremely-useful-classes")
|
|
84
87
|
|
|
@@ -175,6 +178,12 @@ function target_(value) {
|
|
|
175
178
|
|
|
176
179
|
// eslint-disable-next-line max-statements
|
|
177
180
|
function createObjectWithTargetKey(value) {
|
|
181
|
+
const name = construct({
|
|
182
|
+
target: TernaryCompare,
|
|
183
|
+
// eslint-disable-next-line sort-keys
|
|
184
|
+
args: [isString(value), `"${value}"`, getFnName(value)],
|
|
185
|
+
}).compare()
|
|
186
|
+
global[name] = value
|
|
178
187
|
let string = toStr(target_)
|
|
179
188
|
string = arrayGetMember(
|
|
180
189
|
// eslint-disable-next-line unicorn/prefer-string-slice
|
|
@@ -198,13 +207,9 @@ function createObjectWithTargetKey(value) {
|
|
|
198
207
|
string,
|
|
199
208
|
// eslint-disable-next-line unicorn/prefer-string-slice
|
|
200
209
|
toStr(target_).substr(seventeen, five),
|
|
201
|
-
|
|
202
|
-
target: TernaryCompare,
|
|
203
|
-
// eslint-disable-next-line sort-keys
|
|
204
|
-
args: [isString(value), `"${value}"`, value.name]
|
|
205
|
-
}).compare()
|
|
210
|
+
name,
|
|
206
211
|
)
|
|
207
|
-
// eslint-disable-next-line unicorn/prefer-string-slice
|
|
212
|
+
// eslint-disable-next-line unicorn/prefer-string-slice, one-var
|
|
208
213
|
const array = split(string, toStr(target_).substr(twentyNine, six))
|
|
209
214
|
array.shift()
|
|
210
215
|
// eslint-disable-next-line unicorn/prefer-string-slice, no-eval, sonarjs/code-eval
|
|
@@ -213,7 +218,7 @@ function createObjectWithTargetKey(value) {
|
|
|
213
218
|
|
|
214
219
|
// eslint-disable-next-line init-declarations
|
|
215
220
|
let noFruitLeftMessage,
|
|
216
|
-
// eslint-disable-next-line init-declarations
|
|
221
|
+
// eslint-disable-next-line init-declarations
|
|
217
222
|
personIsNotHungryAndCannotBeFedMessage,
|
|
218
223
|
// eslint-disable-next-line init-declarations
|
|
219
224
|
portionSizeExpectedToBeAPositiveIntegerMessage,
|
|
@@ -223,7 +228,7 @@ let noFruitLeftMessage,
|
|
|
223
228
|
objectGetMember(
|
|
224
229
|
just,
|
|
225
230
|
"call",
|
|
226
|
-
// eslint-disable-next-line max-lines-per-function, max-statements
|
|
231
|
+
// eslint-disable-next-line max-lines-per-function, max-statements
|
|
227
232
|
)(() => {
|
|
228
233
|
ErrorMap.set(ErrorType.BaseError, $BaseError)
|
|
229
234
|
ErrorMap.set(ErrorType.EvalError, $EvalError)
|
|
@@ -352,11 +357,11 @@ function CreateSleepFunction(delay) {
|
|
|
352
357
|
}
|
|
353
358
|
|
|
354
359
|
function CreateError(error, message) {
|
|
355
|
-
return construct(
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
+
return construct(
|
|
361
|
+
assign(createObjectWithTargetKey(error), {
|
|
362
|
+
args: asArray(message),
|
|
363
|
+
}),
|
|
364
|
+
)
|
|
360
365
|
}
|
|
361
366
|
|
|
362
367
|
exports.immediateError = function immediateError(message, errorType) {
|
|
@@ -372,7 +377,7 @@ exports.immediateError = function immediateError(message, errorType) {
|
|
|
372
377
|
})
|
|
373
378
|
.rescue(() => {
|
|
374
379
|
attempt(() => {
|
|
375
|
-
|
|
380
|
+
// eslint-disable-next-line new-cap, unicorn/throw-new-error
|
|
376
381
|
error = CreateError(errorType, message)
|
|
377
382
|
})
|
|
378
383
|
.rescue(() => {
|
|
@@ -413,7 +418,7 @@ exports.getError = function getError(errorType) {
|
|
|
413
418
|
return construct({
|
|
414
419
|
target: TernaryCompare,
|
|
415
420
|
// eslint-disable-next-line sort-keys
|
|
416
|
-
args: [ErrorMap.get(errorType), ErrorMap.get(errorType), errorType]
|
|
421
|
+
args: [ErrorMap.get(errorType), ErrorMap.get(errorType), errorType],
|
|
417
422
|
}).compare()
|
|
418
423
|
}
|
|
419
424
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "immediate-error",
|
|
3
|
-
"version": "12.2.
|
|
3
|
+
"version": "12.2.5",
|
|
4
4
|
"description": "enterprise errors",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -49,11 +49,12 @@
|
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://github.com/enterprise-npm-ai/immediate-error#readme",
|
|
51
51
|
"dependencies": {
|
|
52
|
+
"@10xly/global": "^1.1.1",
|
|
52
53
|
"@10xly/strict-equals": "1.0.1",
|
|
53
|
-
"@characters/right-parenthesis": "2.1.0",
|
|
54
54
|
"@extra-array/head": "^2.10.19",
|
|
55
55
|
"@extra-array/last": "^2.10.19",
|
|
56
56
|
"@falsejs/validation-failed-to-pass-error": "^1.0.1",
|
|
57
|
+
"@frosted/object.assign": "^1.0.0",
|
|
57
58
|
"@is-(unknown)/is-false": "1.5.0",
|
|
58
59
|
"@is-(unknown)/is-nan": "1.0.0",
|
|
59
60
|
"@is-(unknown)/is-negative-zero": "1.0.0",
|
|
@@ -91,6 +92,7 @@
|
|
|
91
92
|
"bail": "^1.0.5",
|
|
92
93
|
"basic-functions": "^1.0.6",
|
|
93
94
|
"bigint-intrinsic-ai": "1.0.0",
|
|
95
|
+
"call-bind-enterprise": "^1.0.0",
|
|
94
96
|
"construct-new": "^2.0.8",
|
|
95
97
|
"deep-freeze-node3": "^1.1.0",
|
|
96
98
|
"empty-string": "1.1.1",
|
|
@@ -111,6 +113,7 @@
|
|
|
111
113
|
"libvegetable": "^1.0.0",
|
|
112
114
|
"lodash.stubarray": "^4.13.0",
|
|
113
115
|
"lolite.__private.multiplyfallback": "^1.1.17",
|
|
116
|
+
"name-of-function": "^1.0.2",
|
|
114
117
|
"node-call.then": "^1.0.0",
|
|
115
118
|
"none": "^1.0.0",
|
|
116
119
|
"noop-enterprise": "^2.0.1",
|
|
@@ -127,11 +130,9 @@
|
|
|
127
130
|
"simple-lru-cache": "^0.0.2",
|
|
128
131
|
"str-replaceallof-es": "1.0.0",
|
|
129
132
|
"string.prototype.at": "^1.0.6",
|
|
130
|
-
"string.prototype.replaceall": "1.0.11",
|
|
131
133
|
"string.prototype.split": "^1.0.9",
|
|
132
134
|
"subtract": "^0.0.3",
|
|
133
135
|
"true-value": "^3.0.0",
|
|
134
|
-
"uncurry-x": "^1.0.1",
|
|
135
136
|
"unicode": "^14.0.0",
|
|
136
137
|
"use-unused-vars": "^1.0.1",
|
|
137
138
|
"utf8-byte-length": "^1.0.5"
|