immediate-error 12.2.1 → 12.2.2

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 CHANGED
@@ -40,6 +40,8 @@ immediateError("person not hungry error", ErrorType.PersonNotHungryError) // thr
40
40
 
41
41
  immediateError("portions error", ErrorType.PortionsError) // throws a PortionsError
42
42
 
43
+ immediateError("falsejs validation failed to pass error", ErrorType.FalseJSValidationFailedToPassError) // throws a FalseJSValidationFailedToPassError
44
+
43
45
  class MyCustomError extends Error {
44
46
  constructor (message) {
45
47
  super("Custom: " + message)
@@ -107,6 +109,7 @@ console.log(MESSAGES.DOMAIN.VEGETABLES_DO_NOT_TALK_ERROR.VEGETABLES_CAN_NOT_TALK
107
109
  console.log(MESSAGES.DOMAIN.PERSON_NOT_HUNGRY_ERROR.IS_NOT_HUNGRY_AND_CANNOT_BE_FED) // "% is not hungry and cannot be fed"
108
110
  console.log(MESSAGES.DOMAIN.PORTIONS_ERROR.PORTION_SIZE_EXPECTED_TO_BE_A_POSITIVE_INTEGER) // "Portion size expected to be a positive integer"
109
111
  console.log(MESSAGES.DOMAIN.PORTIONS_ERROR.TOO_MANY_PORTIONS) // "Too many portions"
112
+ console.log(MESSAGES.DOMAIN.FALSEJS_VALIDATION_FAILED_TO_PASS_ERROR.VALIDATION_FAILED_TO_PASS) // "Validation failed to pass"
110
113
  ```
111
114
 
112
115
  ## `immediate-error` 2.0.0
package/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export enum ErrorType {
11
11
  VegetablesDoNotTalkError = 8,
12
12
  PersonNotHungryError = 9,
13
13
  PortionsError = 10,
14
+ FalseJSValidationFailedToPassError = 11
14
15
  }
15
16
  export type CustomError = {
16
17
  new (message: string): Error
@@ -32,6 +33,7 @@ export function getError(
32
33
  ): CustomError
33
34
  export function getError(errorType: ErrorType.PersonNotHungryError): CustomError
34
35
  export function getError(errorType: ErrorType.PortionsError): CustomError
36
+ export function getError(errorType: ErrorType.FalseJSValidationFailedToPassError): CustomError
35
37
  export function getError(errorType: ErrorType | CustomError): CustomError
36
38
  export function immediateError(
37
39
  message?: string,
@@ -78,6 +80,9 @@ export const MESSAGES: {
78
80
  PORTIONS_ERROR: {
79
81
  PORTION_SIZE_EXPECTED_TO_BE_A_POSITIVE_INTEGER: "Portion size expected to be a positive integer",
80
82
  TOO_MANY_PORTIONS: "Too many portions"
83
+ },
84
+ FALSEJS_VALIDATION_FAILED_TO_PASS_ERROR: {
85
+ VALIDATION_FAILED_TO_PASS: "Validation failed to pass"
81
86
  }
82
87
  }
83
88
  }
package/index.js CHANGED
@@ -114,6 +114,8 @@ const $SyntaxError = require("es-error-intrinsics/SyntaxError")
114
114
  const $TypeError = require("es-error-intrinsics/TypeError")
115
115
  const $URIError = require("es-error-intrinsics/URIError")
116
116
 
117
+ const FalseJSValidationFailedToPassError = require("@falsejs/validation-failed-to-pass-error")
118
+
117
119
  const captureStackTrace = GetIntrinsic("%Error.captureStackTrace%", trueValue())
118
120
 
119
121
  const default_error = concat(E, R, R, O, R, EXCLAMATION_POINT)
@@ -130,6 +132,7 @@ const ErrorType = deepFreeze({
130
132
  VegetablesDoNotTalkError: eight,
131
133
  PersonNotHungryError: nine,
132
134
  PortionsError: ten,
135
+ FalseJSValidationFailedToPassError: eleven
133
136
  })
134
137
 
135
138
  const ErrorMap = construct({
@@ -285,6 +288,8 @@ objGetMember(
285
288
  return result
286
289
  }),
287
290
  )
291
+
292
+ ErrorMap.set(ErrorType.FalseJSValidationFailedToPassError, FalseJSValidationFailedToPassError)
288
293
  })
289
294
 
290
295
  function CreateSleepFunction(delay) {
@@ -399,6 +404,9 @@ exports.MESSAGES = {
399
404
  PORTIONS_ERROR: {
400
405
  PORTION_SIZE_EXPECTED_TO_BE_A_POSITIVE_INTEGER: portionSizeExpectedToBeAPositiveIntegerMessage,
401
406
  TOO_MANY_PORTIONS: tooManyPortionsMessage
407
+ },
408
+ FALSEJS_VALIDATION_FAILED_TO_PASS_ERROR: {
409
+ VALIDATION_FAILED_TO_PASS: "Validation failed to pass" // use the error message directly as we don't want to install FalseJS because it is really heavy.
402
410
  }
403
411
  }
404
412
  }
package/index.test.js CHANGED
@@ -1,257 +1,265 @@
1
- // tests
2
-
3
- const {
4
- immediateError,
5
- ErrorType,
6
- throwWhatever,
7
- getError,
8
- MESSAGES
9
- } = require("./index")
10
-
11
- describe("immediateError utility", () => {
12
- test("throws a regular Error with default message when no arguments are passed", () => {
13
- expect(() => immediateError()).toThrow(Error)
14
- expect(() => immediateError()).toThrow("ERROR!")
15
- })
16
-
17
- test("throws a regular Error with a custom message", () => {
18
- expect(() => immediateError("Aaaaah")).toThrow(Error)
19
- expect(() => immediateError("Aaaaah")).toThrow("Aaaaah")
20
- })
21
-
22
- test.each([
23
- ["BaseError", ErrorType.BaseError, Error],
24
- ["EvalError", ErrorType.EvalError, EvalError],
25
- ["RangeError", ErrorType.RangeError, RangeError],
26
- ["ReferenceError", ErrorType.ReferenceError, ReferenceError],
27
- ["SyntaxError", ErrorType.SyntaxError, SyntaxError],
28
- ["TypeError", ErrorType.TypeError, TypeError],
29
- ["URIError", ErrorType.URIError, URIError],
30
- ])("throws % when specified", (name, type, constructor) => {
31
- expect(() => immediateError("test message", type)).toThrow(constructor)
32
- })
33
-
34
- test.each([
35
- ["FruitConsumptionError", ErrorType.FruitConsumptionError],
36
- ["VegetablesDoNotTalkError", ErrorType.VegetablesDoNotTalkError],
37
- ["PersonNotHungryError", ErrorType.PersonNotHungryError],
38
- ["PortionsError", ErrorType.PortionsError],
39
- ])("throws domain-specific % correctly", (name, type) => {
40
- const expectedConstructor = getError(type)
41
- expect(() => immediateError("enterprise failure", type)).toThrow(expectedConstructor)
42
- expect(() => immediateError("enterprise failure", type)).toThrow("enterprise failure")
43
- })
44
-
45
- test("throws a custom user-defined Error class", () => {
46
- class MyCustomError extends Error {
47
- constructor(message) {
48
- super("Custom: " + message)
49
- this.name = "MyCustomError"
50
- }
51
- }
52
-
53
- expect(() => immediateError("Error!", MyCustomError)).toThrow(MyCustomError)
54
- expect(() => immediateError("Error!", MyCustomError)).toThrow(
55
- "Custom: Error!",
56
- )
57
- })
58
-
59
- test("captures stack trace correctly and hides internal frames", () => {
60
- try {
61
- immediateError("stack check")
62
- } catch (error) {
63
- expect(error.stack).not.toMatch(/at immediateError/)
64
- }
65
- })
66
- })
67
-
68
- const { attempt } = require("./index")
69
-
70
- describe("attempt utility", () => {
71
- test("works as a standard function", () => {
72
- let called = false
73
- attempt(() => {
74
- called = true
75
- }).end()
76
- expect(called).toBe(true)
77
- })
78
-
79
- test("works as a constructor returning an instance", () => {
80
- const instance = new attempt(() => {})
81
- expect(instance).toBeDefined()
82
- expect(typeof instance.rescue).toBe("function")
83
- })
84
-
85
- test("triggers rescue when the handler fails", () => {
86
- let errorCaught = false
87
- attempt(() => {
88
- throw new Error("fail")
89
- })
90
- .rescue((e) => {
91
- errorCaught = true
92
- expect(e.message).toBe("fail")
93
- })
94
- .end()
95
- expect(errorCaught).toBe(true)
96
- })
97
-
98
- test("triggers else only when the handler succeeds", () => {
99
- let elseCalled = false
100
- attempt(() => {
101
- return "success"
102
- })
103
- .else(() => {
104
- elseCalled = true
105
- })
106
- .end()
107
- expect(elseCalled).toBe(true)
108
- })
109
-
110
- test("triggers ensure regardless of success or failure", () => {
111
- let counter = 0
112
-
113
- attempt(() => {})
114
- .ensure(() => {
115
- counter++
116
- })
117
- .end()
118
-
119
- attempt(() => {
120
- throw new Error()
121
- })
122
- .rescue(() => {})
123
- .ensure(() => {
124
- counter++
125
- })
126
- .end()
127
-
128
- expect(counter).toBe(2)
129
- })
130
-
131
- test("returns this (the instance) from chaining methods", () => {
132
- const a = attempt(() => {})
133
- const b = a.rescue(() => {})
134
- const c = b.else(() => {})
135
- const d = c.ensure(() => {})
136
-
137
- expect(a).toBe(d)
138
- })
139
- })
140
-
141
- const { delayedError } = require("./index")
142
-
143
- describe("delayedError utility", () => {
144
- const SHORT_DELAY = 10
145
-
146
- test("throws the error after a specified delay", async () => {
147
- const start = Date.now()
148
-
149
- try {
150
- await delayedError("Delayed fail", ErrorType.BaseError, SHORT_DELAY)
151
- } catch (error) {
152
- const duration = Date.now() - start
153
- expect(duration).toBeGreaterThanOrEqual(SHORT_DELAY)
154
- expect(error.message).toBe("Delayed fail")
155
- }
156
- })
157
-
158
- test("uses default error message and type if only delay is provided", async () => {
159
- try {
160
- await delayedError(undefined, undefined, SHORT_DELAY)
161
- } catch (error) {
162
- expect(error.message).toBe("ERROR!")
163
- expect(error).toBeInstanceOf(Error)
164
- }
165
- })
166
-
167
- test("respects custom error types in delayed mode", async () => {
168
- try {
169
- await delayedError("Type fail", ErrorType.TypeError, SHORT_DELAY)
170
- } catch (error) {
171
- expect(error).toBeInstanceOf(TypeError)
172
- expect(error.message).toBe("Type fail")
173
- }
174
- })
175
- })
176
-
177
- describe("throwWhatever utility", () => {
178
- test("throws a standard error object when passed", () => {
179
- const err = new Error("standard fail")
180
- expect(() => throwWhatever(err)).toThrow("standard fail")
181
- })
182
-
183
- test("throws primitive false when passed false", () => {
184
- try {
185
- throwWhatever(false)
186
- } catch (e) {
187
- expect(e).toBe(false)
188
- }
189
- })
190
-
191
- test("throws primitive zero when passed 0", () => {
192
- try {
193
- throwWhatever(0)
194
- } catch (e) {
195
- expect(e).toBe(0)
196
- }
197
- })
198
-
199
- test("throws a string directly when passed a string", () => {
200
- expect(() => throwWhatever("Direct String")).toThrow("Direct String")
201
- })
202
-
203
- test("integrates with getError for custom domain errors", () => {
204
- const FruitError = getError(ErrorType.FruitConsumptionError)
205
- const err = new FruitError("Too many apples")
206
- expect(() => throwWhatever(err)).toThrow(FruitError)
207
- })
208
- })
209
-
210
- describe("getError utility", () => {
211
- test("returns the intrinsic Error constructor for BaseError", () => {
212
- const result = getError(ErrorType.BaseError)
213
- expect(result).toBe(Error)
214
- })
215
-
216
- test("returns the intrinsic TypeError constructor for TypeError", () => {
217
- const result = getError(ErrorType.TypeError)
218
- expect(result).toBe(TypeError)
219
- })
220
-
221
- test("successfully extracts FruitConsumptionError from jsfruit logic", () => {
222
- const FruitError = getError(ErrorType.FruitConsumptionError)
223
- expect(typeof FruitError).toBe("function")
224
- const instance = new FruitError("test")
225
- expect(instance).toBeInstanceOf(Error)
226
- })
227
-
228
- test("successfully extracts PersonNotHungryError from libperson logic", () => {
229
- const HungerError = getError(ErrorType.PersonNotHungryError)
230
- expect(typeof HungerError).toBe("function")
231
- expect(new HungerError()).toBeDefined()
232
- })
233
-
234
- test("successfully extracts PortionsError from libguacamole logic", () => {
235
- const GuacError = getError(ErrorType.PortionsError)
236
- expect(typeof GuacError).toBe("function")
237
- expect(GuacError.name).toBe("PortionsError")
238
- })
239
-
240
- test("returns the same constructor when passed a constructor (identity)", () => {
241
- class MyError extends Error {}
242
- const result = getError(MyError)
243
- expect(result).toBe(MyError)
244
- })
245
- })
246
-
247
- describe("error messages", () => {
248
- test.each([
249
- ["no fruit left", MESSAGES.DOMAIN.FRUIT_CONSUMPTION_ERROR.NO_FRUIT_LEFT],
250
- ["vegetables can not talk", MESSAGES.DOMAIN.VEGETABLES_DO_NOT_TALK_ERROR.VEGETABLES_CAN_NOT_TALK],
251
- ["% is not hungry and cannot be fed", MESSAGES.DOMAIN.PERSON_NOT_HUNGRY_ERROR.IS_NOT_HUNGRY_AND_CANNOT_BE_FED],
252
- ["Portion size expected to be a positive integer", MESSAGES.DOMAIN.PORTIONS_ERROR.PORTION_SIZE_EXPECTED_TO_BE_A_POSITIVE_INTEGER],
253
- ["Too many portions", MESSAGES.DOMAIN.PORTIONS_ERROR.TOO_MANY_PORTIONS]
254
- ])("provides error message \"%s\" correctly", (a, b) => {
255
- expect(a).toEqual(b)
256
- })
257
- })
1
+ // tests
2
+
3
+ const {
4
+ immediateError,
5
+ ErrorType,
6
+ throwWhatever,
7
+ getError,
8
+ MESSAGES
9
+ } = require("./index")
10
+
11
+ describe("immediateError utility", () => {
12
+ test("throws a regular Error with default message when no arguments are passed", () => {
13
+ expect(() => immediateError()).toThrow(Error)
14
+ expect(() => immediateError()).toThrow("ERROR!")
15
+ })
16
+
17
+ test("throws a regular Error with a custom message", () => {
18
+ expect(() => immediateError("Aaaaah")).toThrow(Error)
19
+ expect(() => immediateError("Aaaaah")).toThrow("Aaaaah")
20
+ })
21
+
22
+ test.each([
23
+ ["BaseError", ErrorType.BaseError, Error],
24
+ ["EvalError", ErrorType.EvalError, EvalError],
25
+ ["RangeError", ErrorType.RangeError, RangeError],
26
+ ["ReferenceError", ErrorType.ReferenceError, ReferenceError],
27
+ ["SyntaxError", ErrorType.SyntaxError, SyntaxError],
28
+ ["TypeError", ErrorType.TypeError, TypeError],
29
+ ["URIError", ErrorType.URIError, URIError],
30
+ ])("throws % when specified", (name, type, constructor) => {
31
+ expect(() => immediateError("test message", type)).toThrow(constructor)
32
+ })
33
+
34
+ test.each([
35
+ ["FruitConsumptionError", ErrorType.FruitConsumptionError],
36
+ ["VegetablesDoNotTalkError", ErrorType.VegetablesDoNotTalkError],
37
+ ["PersonNotHungryError", ErrorType.PersonNotHungryError],
38
+ ["PortionsError", ErrorType.PortionsError],
39
+ ["FalseJSValidationFailedToPassError", ErrorType.FalseJSValidationFailedToPassError]
40
+ ])("throws domain-specific % correctly", (name, type) => {
41
+ const expectedConstructor = getError(type)
42
+ expect(() => immediateError("enterprise failure", type)).toThrow(expectedConstructor)
43
+ expect(() => immediateError("enterprise failure", type)).toThrow("enterprise failure")
44
+ })
45
+
46
+ test("throws a custom user-defined Error class", () => {
47
+ class MyCustomError extends Error {
48
+ constructor(message) {
49
+ super("Custom: " + message)
50
+ this.name = "MyCustomError"
51
+ }
52
+ }
53
+
54
+ expect(() => immediateError("Error!", MyCustomError)).toThrow(MyCustomError)
55
+ expect(() => immediateError("Error!", MyCustomError)).toThrow(
56
+ "Custom: Error!",
57
+ )
58
+ })
59
+
60
+ test("captures stack trace correctly and hides internal frames", () => {
61
+ try {
62
+ immediateError("stack check")
63
+ } catch (error) {
64
+ expect(error.stack).not.toMatch(/at immediateError/)
65
+ }
66
+ })
67
+ })
68
+
69
+ const { attempt } = require("./index")
70
+
71
+ describe("attempt utility", () => {
72
+ test("works as a standard function", () => {
73
+ let called = false
74
+ attempt(() => {
75
+ called = true
76
+ }).end()
77
+ expect(called).toBe(true)
78
+ })
79
+
80
+ test("works as a constructor returning an instance", () => {
81
+ const instance = new attempt(() => {})
82
+ expect(instance).toBeDefined()
83
+ expect(typeof instance.rescue).toBe("function")
84
+ })
85
+
86
+ test("triggers rescue when the handler fails", () => {
87
+ let errorCaught = false
88
+ attempt(() => {
89
+ throw new Error("fail")
90
+ })
91
+ .rescue((e) => {
92
+ errorCaught = true
93
+ expect(e.message).toBe("fail")
94
+ })
95
+ .end()
96
+ expect(errorCaught).toBe(true)
97
+ })
98
+
99
+ test("triggers else only when the handler succeeds", () => {
100
+ let elseCalled = false
101
+ attempt(() => {
102
+ return "success"
103
+ })
104
+ .else(() => {
105
+ elseCalled = true
106
+ })
107
+ .end()
108
+ expect(elseCalled).toBe(true)
109
+ })
110
+
111
+ test("triggers ensure regardless of success or failure", () => {
112
+ let counter = 0
113
+
114
+ attempt(() => {})
115
+ .ensure(() => {
116
+ counter++
117
+ })
118
+ .end()
119
+
120
+ attempt(() => {
121
+ throw new Error()
122
+ })
123
+ .rescue(() => {})
124
+ .ensure(() => {
125
+ counter++
126
+ })
127
+ .end()
128
+
129
+ expect(counter).toBe(2)
130
+ })
131
+
132
+ test("returns this (the instance) from chaining methods", () => {
133
+ const a = attempt(() => {})
134
+ const b = a.rescue(() => {})
135
+ const c = b.else(() => {})
136
+ const d = c.ensure(() => {})
137
+
138
+ expect(a).toBe(d)
139
+ })
140
+ })
141
+
142
+ const { delayedError } = require("./index")
143
+
144
+ describe("delayedError utility", () => {
145
+ const SHORT_DELAY = 10
146
+
147
+ test("throws the error after a specified delay", async () => {
148
+ const start = Date.now()
149
+
150
+ try {
151
+ await delayedError("Delayed fail", ErrorType.BaseError, SHORT_DELAY)
152
+ } catch (error) {
153
+ const duration = Date.now() - start
154
+ expect(duration).toBeGreaterThanOrEqual(SHORT_DELAY)
155
+ expect(error.message).toBe("Delayed fail")
156
+ }
157
+ })
158
+
159
+ test("uses default error message and type if only delay is provided", async () => {
160
+ try {
161
+ await delayedError(undefined, undefined, SHORT_DELAY)
162
+ } catch (error) {
163
+ expect(error.message).toBe("ERROR!")
164
+ expect(error).toBeInstanceOf(Error)
165
+ }
166
+ })
167
+
168
+ test("respects custom error types in delayed mode", async () => {
169
+ try {
170
+ await delayedError("Type fail", ErrorType.TypeError, SHORT_DELAY)
171
+ } catch (error) {
172
+ expect(error).toBeInstanceOf(TypeError)
173
+ expect(error.message).toBe("Type fail")
174
+ }
175
+ })
176
+ })
177
+
178
+ describe("throwWhatever utility", () => {
179
+ test("throws a standard error object when passed", () => {
180
+ const err = new Error("standard fail")
181
+ expect(() => throwWhatever(err)).toThrow("standard fail")
182
+ })
183
+
184
+ test("throws primitive false when passed false", () => {
185
+ try {
186
+ throwWhatever(false)
187
+ } catch (e) {
188
+ expect(e).toBe(false)
189
+ }
190
+ })
191
+
192
+ test("throws primitive zero when passed 0", () => {
193
+ try {
194
+ throwWhatever(0)
195
+ } catch (e) {
196
+ expect(e).toBe(0)
197
+ }
198
+ })
199
+
200
+ test("throws a string directly when passed a string", () => {
201
+ expect(() => throwWhatever("Direct String")).toThrow("Direct String")
202
+ })
203
+
204
+ test("integrates with getError for custom domain errors", () => {
205
+ const FruitError = getError(ErrorType.FruitConsumptionError)
206
+ const err = new FruitError("Too many apples")
207
+ expect(() => throwWhatever(err)).toThrow(FruitError)
208
+ })
209
+ })
210
+
211
+ describe("getError utility", () => {
212
+ test("returns the intrinsic Error constructor for BaseError", () => {
213
+ const result = getError(ErrorType.BaseError)
214
+ expect(result).toBe(Error)
215
+ })
216
+
217
+ test("returns the intrinsic TypeError constructor for TypeError", () => {
218
+ const result = getError(ErrorType.TypeError)
219
+ expect(result).toBe(TypeError)
220
+ })
221
+
222
+ test("successfully extracts FruitConsumptionError from jsfruit logic", () => {
223
+ const FruitError = getError(ErrorType.FruitConsumptionError)
224
+ expect(typeof FruitError).toBe("function")
225
+ const instance = new FruitError("test")
226
+ expect(instance).toBeInstanceOf(Error)
227
+ })
228
+
229
+ test("successfully extracts PersonNotHungryError from libperson logic", () => {
230
+ const HungerError = getError(ErrorType.PersonNotHungryError)
231
+ expect(typeof HungerError).toBe("function")
232
+ expect(new HungerError()).toBeDefined()
233
+ })
234
+
235
+ test("successfully extracts PortionsError from libguacamole logic", () => {
236
+ const GuacError = getError(ErrorType.PortionsError)
237
+ expect(typeof GuacError).toBe("function")
238
+ expect(GuacError.name).toBe("PortionsError")
239
+ })
240
+
241
+ test("successfully extracts FalseJSValidationFailedToPassError", () => {
242
+ const FalseJSValidationFailedToPassError = getError(ErrorType.FalseJSValidationFailedToPassError)
243
+ expect(typeof FalseJSValidationFailedToPassError).toBe("function")
244
+ expect(FalseJSValidationFailedToPassError.name).toBe("FalseJSValidationFailedToPassError")
245
+ })
246
+
247
+ test("returns the same constructor when passed a constructor (identity)", () => {
248
+ class MyError extends Error {}
249
+ const result = getError(MyError)
250
+ expect(result).toBe(MyError)
251
+ })
252
+ })
253
+
254
+ describe("error messages", () => {
255
+ test.each([
256
+ ["no fruit left", MESSAGES.DOMAIN.FRUIT_CONSUMPTION_ERROR.NO_FRUIT_LEFT],
257
+ ["vegetables can not talk", MESSAGES.DOMAIN.VEGETABLES_DO_NOT_TALK_ERROR.VEGETABLES_CAN_NOT_TALK],
258
+ ["% is not hungry and cannot be fed", MESSAGES.DOMAIN.PERSON_NOT_HUNGRY_ERROR.IS_NOT_HUNGRY_AND_CANNOT_BE_FED],
259
+ ["Portion size expected to be a positive integer", MESSAGES.DOMAIN.PORTIONS_ERROR.PORTION_SIZE_EXPECTED_TO_BE_A_POSITIVE_INTEGER],
260
+ ["Too many portions", MESSAGES.DOMAIN.PORTIONS_ERROR.TOO_MANY_PORTIONS],
261
+ ["Validation failed to pass", MESSAGES.DOMAIN.FALSEJS_VALIDATION_FAILED_TO_PASS_ERROR.VALIDATION_FAILED_TO_PASS]
262
+ ])("provides error message \"%s\" correctly", (a, b) => {
263
+ expect(a).toEqual(b)
264
+ })
265
+ })
package/package.json CHANGED
@@ -1,139 +1,140 @@
1
- {
2
- "name": "immediate-error",
3
- "version": "12.2.1",
4
- "description": "enterprise errors",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "jest index.test.js"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/enterprise-npm-ai/immediate-error.git"
12
- },
13
- "keywords": [
14
- "error",
15
- "throw",
16
- "immediate-error",
17
- "tool",
18
- "10x'ness",
19
- "10x'ly made",
20
- "10x",
21
- "10x-engineer",
22
- "10x engineer",
23
- "10x engineering",
24
- "jsfruit",
25
- "libperson",
26
- "libvegetable",
27
- "bail",
28
- "throw-error",
29
- "sigma",
30
- "lifesaver",
31
- "framework",
32
- "js",
33
- "ecmascript",
34
- "javascript",
35
- "licensed",
36
- "jest",
37
- "67",
38
- "fp",
39
- "enterprise-npm-ai",
40
- "sigmaskibidi",
41
- "tj-commits",
42
- "skibidi-toilet-hacker",
43
- "stevelib"
44
- ],
45
- "author": "10x'ly Made",
46
- "license": "EGPSL10X-1.0",
47
- "bugs": {
48
- "url": "https://github.com/enterprise-npm-ai/immediate-error/issues"
49
- },
50
- "homepage": "https://github.com/enterprise-npm-ai/immediate-error#readme",
51
- "dependencies": {
52
- "@10xly/strict-equals": "1.0.1",
53
- "@characters/right-parenthesis": "2.1.0",
54
- "@extra-array/head": "^2.10.19",
55
- "@extra-array/last": "^2.10.19",
56
- "@is-(unknown)/is-false": "1.5.0",
57
- "@is-(unknown)/is-nan": "1.0.0",
58
- "@is-(unknown)/is-negative-zero": "1.0.0",
59
- "@is-(unknown)/is-nil": "1.2.0",
60
- "@is-(unknown)/is-null": "1.3.0",
61
- "@is-(unknown)/is-string": "^1.0.0",
62
- "@is-(unknown)/is-undefined": "1.3.0",
63
- "@negative-numbers/eighty-seven": "^1.0.0",
64
- "@negative-numbers/zero": "1.0.0",
65
- "@positive-numbers/eight": "^3.0.0",
66
- "@positive-numbers/eleven": "^3.0.0",
67
- "@positive-numbers/five": "^3.0.0",
68
- "@positive-numbers/four": "^3.0.0",
69
- "@positive-numbers/nine": "^3.0.0",
70
- "@positive-numbers/one": "^3.0.0",
71
- "@positive-numbers/seven": "^3.0.0",
72
- "@positive-numbers/seventeen": "^3.0.0",
73
- "@positive-numbers/six": "^3.0.0",
74
- "@positive-numbers/ten": "^3.0.0",
75
- "@positive-numbers/thirty-three": "^3.0.0",
76
- "@positive-numbers/three": "^3.0.0",
77
- "@positive-numbers/twenty-five": "^4.0.0",
78
- "@positive-numbers/twenty-nine": "^3.0.0",
79
- "@positive-numbers/two": "^3.0.0",
80
- "@positive-numbers/zero": "^5.0.0",
81
- "@redux-saga/delay-p": "^1.3.1",
82
- "@rightpad/concat": "^1.0.0",
83
- "@rightpad/convert2string": "^1.0.0",
84
- "@uppercase-letters/e": "^3.0.0",
85
- "@uppercase-letters/o": "^3.0.0",
86
- "@uppercase-letters/r": "^3.0.0",
87
- "array-get-member": "^1.0.4",
88
- "array.prototype.join": "^1.0.4",
89
- "attempt-statement": "^1.2.1",
90
- "bail": "^1.0.5",
91
- "basic-functions": "^1.0.6",
92
- "bigint-intrinsic-ai": "1.0.0",
93
- "construct-new": "^2.0.8",
94
- "deep-freeze-node3": "^1.1.0",
95
- "empty-string": "1.1.1",
96
- "es-error-intrinsics": "^1.0.1",
97
- "es-intrinsic-cache": "^1.0.1",
98
- "es-logical-nullish-coalescing-operator": "^1.0.0",
99
- "false-value": "^2.0.6",
100
- "fizzbuzz-enterprise": "^1.0.0",
101
- "for-each": "^0.3.5",
102
- "function-bind": "^1.1.2",
103
- "get-member": "^1337.69.420",
104
- "is-": "^1.0.0",
105
- "is-not-integer": "^1.0.2",
106
- "jsfruit": "^1.1.0",
107
- "libguacamole": "^1.0.0",
108
- "libperson": "^1.0.0",
109
- "libvegetable": "^1.0.0",
110
- "lodash.stubarray": "^4.13.0",
111
- "lolite.__private.multiplyfallback": "^1.1.17",
112
- "node-call.then": "^1.0.0",
113
- "none": "^1.0.0",
114
- "noop-enterprise": "^2.0.1",
115
- "noop10": "1.0.3",
116
- "numero": "^0.1.1",
117
- "object.entries-ponyfill": "^1.0.1",
118
- "object.prototype-intrinsic-ai": "^1.0.1",
119
- "positive-zero": "3.0.0",
120
- "primitive-value-nan": "1.0.1",
121
- "primitive-value-null": "1.0.0",
122
- "primitive-value-undefined": "1.0.0",
123
- "qc-core": "^0.0.0",
124
- "repeating": "^2.0.1",
125
- "simple-lru-cache": "^0.0.2",
126
- "str-replaceallof-es": "1.0.0",
127
- "string.prototype.at": "^1.0.6",
128
- "string.prototype.replaceall": "1.0.11",
129
- "string.prototype.split": "^1.0.9",
130
- "subtract": "^0.0.3",
131
- "true-value": "^3.0.0",
132
- "uncurry-x": "^1.0.1",
133
- "unicode": "^14.0.0",
134
- "utf8-byte-length": "^1.0.5"
135
- },
136
- "devDependencies": {
137
- "jest": "^30.2.0"
138
- }
139
- }
1
+ {
2
+ "name": "immediate-error",
3
+ "version": "12.2.2",
4
+ "description": "enterprise errors",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "jest index.test.js"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/enterprise-npm-ai/immediate-error.git"
12
+ },
13
+ "keywords": [
14
+ "error",
15
+ "throw",
16
+ "immediate-error",
17
+ "tool",
18
+ "10x'ness",
19
+ "10x'ly made",
20
+ "10x",
21
+ "10x-engineer",
22
+ "10x engineer",
23
+ "10x engineering",
24
+ "jsfruit",
25
+ "libperson",
26
+ "libvegetable",
27
+ "bail",
28
+ "throw-error",
29
+ "sigma",
30
+ "lifesaver",
31
+ "framework",
32
+ "js",
33
+ "ecmascript",
34
+ "javascript",
35
+ "licensed",
36
+ "jest",
37
+ "67",
38
+ "fp",
39
+ "enterprise-npm-ai",
40
+ "sigmaskibidi",
41
+ "tj-commits",
42
+ "skibidi-toilet-hacker",
43
+ "stevelib"
44
+ ],
45
+ "author": "10x'ly Made",
46
+ "license": "EGPSL10X-1.0",
47
+ "bugs": {
48
+ "url": "https://github.com/enterprise-npm-ai/immediate-error/issues"
49
+ },
50
+ "homepage": "https://github.com/enterprise-npm-ai/immediate-error#readme",
51
+ "dependencies": {
52
+ "@10xly/strict-equals": "1.0.1",
53
+ "@characters/right-parenthesis": "2.1.0",
54
+ "@extra-array/head": "^2.10.19",
55
+ "@extra-array/last": "^2.10.19",
56
+ "@falsejs/validation-failed-to-pass-error": "^1.0.1",
57
+ "@is-(unknown)/is-false": "1.5.0",
58
+ "@is-(unknown)/is-nan": "1.0.0",
59
+ "@is-(unknown)/is-negative-zero": "1.0.0",
60
+ "@is-(unknown)/is-nil": "1.2.0",
61
+ "@is-(unknown)/is-null": "1.3.0",
62
+ "@is-(unknown)/is-string": "^1.0.0",
63
+ "@is-(unknown)/is-undefined": "1.3.0",
64
+ "@negative-numbers/eighty-seven": "^1.0.0",
65
+ "@negative-numbers/zero": "1.0.0",
66
+ "@positive-numbers/eight": "^3.0.0",
67
+ "@positive-numbers/eleven": "^3.0.0",
68
+ "@positive-numbers/five": "^3.0.0",
69
+ "@positive-numbers/four": "^3.0.0",
70
+ "@positive-numbers/nine": "^3.0.0",
71
+ "@positive-numbers/one": "^3.0.0",
72
+ "@positive-numbers/seven": "^3.0.0",
73
+ "@positive-numbers/seventeen": "^3.0.0",
74
+ "@positive-numbers/six": "^3.0.0",
75
+ "@positive-numbers/ten": "^3.0.0",
76
+ "@positive-numbers/thirty-three": "^3.0.0",
77
+ "@positive-numbers/three": "^3.0.0",
78
+ "@positive-numbers/twenty-five": "^4.0.0",
79
+ "@positive-numbers/twenty-nine": "^3.0.0",
80
+ "@positive-numbers/two": "^3.0.0",
81
+ "@positive-numbers/zero": "^5.0.0",
82
+ "@redux-saga/delay-p": "^1.3.1",
83
+ "@rightpad/concat": "^1.0.0",
84
+ "@rightpad/convert2string": "^1.0.0",
85
+ "@uppercase-letters/e": "^3.0.0",
86
+ "@uppercase-letters/o": "^3.0.0",
87
+ "@uppercase-letters/r": "^3.0.0",
88
+ "array-get-member": "^1.0.4",
89
+ "array.prototype.join": "^1.0.4",
90
+ "attempt-statement": "^1.2.1",
91
+ "bail": "^1.0.5",
92
+ "basic-functions": "^1.0.6",
93
+ "bigint-intrinsic-ai": "1.0.0",
94
+ "construct-new": "^2.0.8",
95
+ "deep-freeze-node3": "^1.1.0",
96
+ "empty-string": "1.1.1",
97
+ "es-error-intrinsics": "^1.0.1",
98
+ "es-intrinsic-cache": "^1.0.1",
99
+ "es-logical-nullish-coalescing-operator": "^1.0.0",
100
+ "false-value": "^2.0.6",
101
+ "fizzbuzz-enterprise": "^1.0.0",
102
+ "for-each": "^0.3.5",
103
+ "function-bind": "^1.1.2",
104
+ "get-member": "^1337.69.420",
105
+ "is-": "^1.0.0",
106
+ "is-not-integer": "^1.0.2",
107
+ "jsfruit": "^1.1.0",
108
+ "libguacamole": "^1.0.0",
109
+ "libperson": "^1.0.0",
110
+ "libvegetable": "^1.0.0",
111
+ "lodash.stubarray": "^4.13.0",
112
+ "lolite.__private.multiplyfallback": "^1.1.17",
113
+ "node-call.then": "^1.0.0",
114
+ "none": "^1.0.0",
115
+ "noop-enterprise": "^2.0.1",
116
+ "noop10": "1.0.3",
117
+ "numero": "^0.1.1",
118
+ "object.entries-ponyfill": "^1.0.1",
119
+ "object.prototype-intrinsic-ai": "^1.0.1",
120
+ "positive-zero": "3.0.0",
121
+ "primitive-value-nan": "1.0.1",
122
+ "primitive-value-null": "1.0.0",
123
+ "primitive-value-undefined": "1.0.0",
124
+ "qc-core": "^0.0.0",
125
+ "repeating": "^2.0.1",
126
+ "simple-lru-cache": "^0.0.2",
127
+ "str-replaceallof-es": "1.0.0",
128
+ "string.prototype.at": "^1.0.6",
129
+ "string.prototype.replaceall": "1.0.11",
130
+ "string.prototype.split": "^1.0.9",
131
+ "subtract": "^0.0.3",
132
+ "true-value": "^3.0.0",
133
+ "uncurry-x": "^1.0.1",
134
+ "unicode": "^14.0.0",
135
+ "utf8-byte-length": "^1.0.5"
136
+ },
137
+ "devDependencies": {
138
+ "jest": "^30.2.0"
139
+ }
140
+ }