@types/node 18.16.5 → 20.1.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.
Files changed (111) hide show
  1. node v18.16/README.md → node/README.md +2 -2
  2. node v18.16/ts4.8/assert.d.ts → node/assert.d.ts +71 -75
  3. node v18.16/async_hooks.d.ts → node/async_hooks.d.ts +62 -42
  4. node v18.16/buffer.d.ts → node/buffer.d.ts +127 -99
  5. node v18.16/child_process.d.ts → node/child_process.d.ts +50 -54
  6. node v18.16/ts4.8/cluster.d.ts → node/cluster.d.ts +12 -12
  7. node v18.16/ts4.8/console.d.ts → node/console.d.ts +5 -5
  8. node v18.16/crypto.d.ts → node/crypto.d.ts +209 -220
  9. node v18.16/ts4.8/dgram.d.ts → node/dgram.d.ts +15 -15
  10. node v18.16/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +25 -26
  11. node v18.16/dns/promises.d.ts → node/dns/promises.d.ts +6 -6
  12. node v18.16/ts4.8/dns.d.ts → node/dns.d.ts +24 -16
  13. node v18.16/domain.d.ts → node/domain.d.ts +4 -4
  14. node v18.16/events.d.ts → node/events.d.ts +60 -60
  15. node v18.16/fs/promises.d.ts → node/fs/promises.d.ts +78 -48
  16. node v18.16/fs.d.ts → node/fs.d.ts +117 -81
  17. node v18.16/http.d.ts → node/http.d.ts +155 -145
  18. node v18.16/ts4.8/http2.d.ts → node/http2.d.ts +42 -46
  19. node v18.16/https.d.ts → node/https.d.ts +52 -153
  20. node v18.16/index.d.ts → node/index.d.ts +1 -1
  21. node v18.16/ts4.8/inspector.d.ts → node/inspector.d.ts +10 -3
  22. node v18.16/ts4.8/module.d.ts → node/module.d.ts +5 -4
  23. node v18.16/ts4.8/net.d.ts → node/net.d.ts +24 -21
  24. node v18.16/ts4.8/os.d.ts → node/os.d.ts +22 -18
  25. node v18.16/package.json → node/package.json +2 -2
  26. node v18.16/ts4.8/path.d.ts → node/path.d.ts +4 -4
  27. node v18.16/perf_hooks.d.ts → node/perf_hooks.d.ts +28 -15
  28. node v18.16/process.d.ts → node/process.d.ts +43 -46
  29. node v18.16/ts4.8/punycode.d.ts → node/punycode.d.ts +1 -1
  30. node v18.16/ts4.8/querystring.d.ts → node/querystring.d.ts +5 -5
  31. node v18.16/readline/promises.d.ts → node/readline/promises.d.ts +6 -4
  32. node v18.16/readline.d.ts → node/readline.d.ts +15 -15
  33. node v18.16/repl.d.ts → node/repl.d.ts +9 -9
  34. node v18.16/stream/consumers.d.ts → node/stream/consumers.d.ts +1 -1
  35. node v18.16/stream.d.ts → node/stream.d.ts +88 -136
  36. node v18.16/ts4.8/string_decoder.d.ts → node/string_decoder.d.ts +6 -6
  37. node v18.16/ts4.8/test.d.ts → node/test.d.ts +423 -186
  38. node v18.16/timers/promises.d.ts → node/timers/promises.d.ts +3 -3
  39. node v18.16/timers.d.ts → node/timers.d.ts +2 -2
  40. node v18.16/ts4.8/tls.d.ts → node/tls.d.ts +24 -16
  41. node v18.16/ts4.8/trace_events.d.ts → node/trace_events.d.ts +20 -9
  42. node v18.16/assert.d.ts → node/ts4.8/assert.d.ts +71 -75
  43. node v18.16/ts4.8/async_hooks.d.ts → node/ts4.8/async_hooks.d.ts +62 -42
  44. node v18.16/ts4.8/buffer.d.ts → node/ts4.8/buffer.d.ts +127 -99
  45. node v18.16/ts4.8/child_process.d.ts → node/ts4.8/child_process.d.ts +50 -54
  46. node v18.16/cluster.d.ts → node/ts4.8/cluster.d.ts +12 -12
  47. node v18.16/console.d.ts → node/ts4.8/console.d.ts +5 -5
  48. node v18.16/ts4.8/crypto.d.ts → node/ts4.8/crypto.d.ts +209 -220
  49. node v18.16/dgram.d.ts → node/ts4.8/dgram.d.ts +15 -15
  50. node v18.16/ts4.8/diagnostics_channel.d.ts → node/ts4.8/diagnostics_channel.d.ts +25 -26
  51. node v18.16/ts4.8/dns/promises.d.ts → node/ts4.8/dns/promises.d.ts +6 -6
  52. node v18.16/dns.d.ts → node/ts4.8/dns.d.ts +24 -16
  53. node v18.16/ts4.8/domain.d.ts → node/ts4.8/domain.d.ts +4 -4
  54. node v18.16/ts4.8/events.d.ts → node/ts4.8/events.d.ts +60 -60
  55. node v18.16/ts4.8/fs/promises.d.ts → node/ts4.8/fs/promises.d.ts +96 -45
  56. node v18.16/ts4.8/fs.d.ts → node/ts4.8/fs.d.ts +203 -67
  57. node v18.16/ts4.8/globals.d.ts → node/ts4.8/globals.d.ts +29 -28
  58. node v18.16/ts4.8/http.d.ts → node/ts4.8/http.d.ts +198 -126
  59. node v18.16/http2.d.ts → node/ts4.8/http2.d.ts +42 -46
  60. node v18.16/ts4.8/https.d.ts → node/ts4.8/https.d.ts +52 -153
  61. node v18.16/inspector.d.ts → node/ts4.8/inspector.d.ts +10 -3
  62. node v18.16/module.d.ts → node/ts4.8/module.d.ts +5 -4
  63. node v18.16/net.d.ts → node/ts4.8/net.d.ts +21 -18
  64. node v18.16/os.d.ts → node/ts4.8/os.d.ts +22 -18
  65. node v18.16/path.d.ts → node/ts4.8/path.d.ts +4 -4
  66. node v18.16/ts4.8/perf_hooks.d.ts → node/ts4.8/perf_hooks.d.ts +28 -15
  67. node v18.16/ts4.8/process.d.ts → node/ts4.8/process.d.ts +43 -46
  68. node v18.16/punycode.d.ts → node/ts4.8/punycode.d.ts +1 -1
  69. node v18.16/querystring.d.ts → node/ts4.8/querystring.d.ts +5 -5
  70. node v18.16/ts4.8/readline/promises.d.ts → node/ts4.8/readline/promises.d.ts +6 -4
  71. node v18.16/ts4.8/readline.d.ts → node/ts4.8/readline.d.ts +15 -15
  72. node v18.16/ts4.8/repl.d.ts → node/ts4.8/repl.d.ts +9 -9
  73. node v18.16/ts4.8/stream/consumers.d.ts → node/ts4.8/stream/consumers.d.ts +1 -1
  74. node v18.16/ts4.8/stream.d.ts → node/ts4.8/stream.d.ts +91 -139
  75. node v18.16/string_decoder.d.ts → node/ts4.8/string_decoder.d.ts +6 -6
  76. node v18.16/test.d.ts → node/ts4.8/test.d.ts +423 -186
  77. node v18.16/ts4.8/timers/promises.d.ts → node/ts4.8/timers/promises.d.ts +3 -3
  78. node v18.16/ts4.8/timers.d.ts → node/ts4.8/timers.d.ts +9 -2
  79. node v18.16/tls.d.ts → node/ts4.8/tls.d.ts +24 -16
  80. node v18.16/trace_events.d.ts → node/ts4.8/trace_events.d.ts +20 -9
  81. node v18.16/tty.d.ts → node/ts4.8/tty.d.ts +4 -5
  82. node v18.16/ts4.8/url.d.ts → node/ts4.8/url.d.ts +26 -36
  83. node v18.16/ts4.8/util.d.ts → node/ts4.8/util.d.ts +143 -116
  84. node v18.16/ts4.8/v8.d.ts → node/ts4.8/v8.d.ts +110 -16
  85. node v18.16/vm.d.ts → node/ts4.8/vm.d.ts +292 -42
  86. node v18.16/wasi.d.ts → node/ts4.8/wasi.d.ts +13 -19
  87. node v18.16/ts4.8/worker_threads.d.ts → node/ts4.8/worker_threads.d.ts +32 -34
  88. node v18.16/zlib.d.ts → node/ts4.8/zlib.d.ts +11 -11
  89. node v18.16/ts4.8/tty.d.ts → node/tty.d.ts +4 -5
  90. node v18.16/url.d.ts → node/url.d.ts +26 -36
  91. node v18.16/util.d.ts → node/util.d.ts +146 -111
  92. node v18.16/v8.d.ts → node/v8.d.ts +110 -16
  93. node v18.16/ts4.8/vm.d.ts → node/vm.d.ts +292 -42
  94. node v18.16/ts4.8/wasi.d.ts → node/wasi.d.ts +13 -19
  95. node v18.16/worker_threads.d.ts → node/worker_threads.d.ts +32 -34
  96. node v18.16/ts4.8/zlib.d.ts → node/zlib.d.ts +11 -11
  97. {node v18.16 → node}/LICENSE +0 -0
  98. {node v18.16 → node}/assert/strict.d.ts +0 -0
  99. {node v18.16 → node}/constants.d.ts +0 -0
  100. {node v18.16 → node}/dom-events.d.ts +0 -0
  101. {node v18.16 → node}/globals.d.ts +0 -0
  102. {node v18.16 → node}/globals.global.d.ts +0 -0
  103. {node v18.16 → node}/stream/promises.d.ts +0 -0
  104. {node v18.16 → node}/stream/web.d.ts +0 -0
  105. {node v18.16 → node}/ts4.8/assert/strict.d.ts +0 -0
  106. {node v18.16 → node}/ts4.8/constants.d.ts +0 -0
  107. {node v18.16 → node}/ts4.8/dom-events.d.ts +0 -0
  108. {node v18.16 → node}/ts4.8/globals.global.d.ts +0 -0
  109. {node v18.16 → node}/ts4.8/index.d.ts +0 -0
  110. {node v18.16 → node}/ts4.8/stream/promises.d.ts +0 -0
  111. {node v18.16 → node}/ts4.8/stream/web.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  /**
2
- * The `assert` module provides a set of assertion functions for verifying
2
+ * The `node:assert` module provides a set of assertion functions for verifying
3
3
  * invariants.
4
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/assert.js)
4
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/assert.js)
5
5
  */
6
6
  declare module 'assert' {
7
7
  /**
@@ -12,8 +12,7 @@ declare module 'assert' {
12
12
  function assert(value: unknown, message?: string | Error): asserts value;
13
13
  namespace assert {
14
14
  /**
15
- * Indicates the failure of an assertion. All errors thrown by the `assert` module
16
- * will be instances of the `AssertionError` class.
15
+ * Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class.
17
16
  */
18
17
  class AssertionError extends Error {
19
18
  actual: unknown;
@@ -36,9 +35,10 @@ declare module 'assert' {
36
35
  });
37
36
  }
38
37
  /**
39
- * This feature is currently experimental and behavior might still change.
38
+ * This feature is deprecated and will be removed in a future version.
39
+ * Please consider using alternatives such as the `mock` helper function.
40
40
  * @since v14.2.0, v12.19.0
41
- * @experimental
41
+ * @deprecated Deprecated
42
42
  */
43
43
  class CallTracker {
44
44
  /**
@@ -47,7 +47,7 @@ declare module 'assert' {
47
47
  * error.
48
48
  *
49
49
  * ```js
50
- * import assert from 'assert';
50
+ * import assert from 'node:assert';
51
51
  *
52
52
  * // Creates call tracker.
53
53
  * const tracker = new assert.CallTracker();
@@ -78,12 +78,11 @@ declare module 'assert' {
78
78
  * callsfunc(1, 2, 3);
79
79
  *
80
80
  * assert.deepStrictEqual(tracker.getCalls(callsfunc),
81
- * [{ thisArg: this, arguments: [1, 2, 3 ] }]);
81
+ * [{ thisArg: undefined, arguments: [1, 2, 3] }]);
82
82
  * ```
83
- *
84
83
  * @since v18.8.0, v16.18.0
85
- * @params fn
86
- * @returns An Array with the calls to a tracked function.
84
+ * @param fn
85
+ * @return An Array with all the calls to a tracked function.
87
86
  */
88
87
  getCalls(fn: Function): CallTrackerCall[];
89
88
  /**
@@ -91,21 +90,19 @@ declare module 'assert' {
91
90
  * the functions that have not been called the expected number of times.
92
91
  *
93
92
  * ```js
94
- * import assert from 'assert';
93
+ * import assert from 'node:assert';
95
94
  *
96
95
  * // Creates call tracker.
97
96
  * const tracker = new assert.CallTracker();
98
97
  *
99
98
  * function func() {}
100
99
  *
101
- * function foo() {}
102
- *
103
100
  * // Returns a function that wraps func() that must be called exact times
104
101
  * // before tracker.verify().
105
102
  * const callsfunc = tracker.calls(func, 2);
106
103
  *
107
104
  * // Returns an array containing information on callsfunc()
108
- * tracker.report();
105
+ * console.log(tracker.report());
109
106
  * // [
110
107
  * // {
111
108
  * // message: 'Expected the func function to be executed 2 time(s) but was
@@ -118,7 +115,7 @@ declare module 'assert' {
118
115
  * // ]
119
116
  * ```
120
117
  * @since v14.2.0, v12.19.0
121
- * @return of objects containing information about the wrapper functions returned by `calls`.
118
+ * @return An Array of objects containing information about the wrapper functions returned by `calls`.
122
119
  */
123
120
  report(): CallTrackerReportInformation[];
124
121
  /**
@@ -136,12 +133,11 @@ declare module 'assert' {
136
133
  *
137
134
  * callsfunc();
138
135
  * // Tracker was called once
139
- * tracker.getCalls(callsfunc).length === 1;
136
+ * assert.strictEqual(tracker.getCalls(callsfunc).length, 1);
140
137
  *
141
138
  * tracker.reset(callsfunc);
142
- * tracker.getCalls(callsfunc).length === 0;
139
+ * assert.strictEqual(tracker.getCalls(callsfunc).length, 0);
143
140
  * ```
144
- *
145
141
  * @since v18.8.0, v16.18.0
146
142
  * @param fn a tracked function to reset.
147
143
  */
@@ -151,7 +147,7 @@ declare module 'assert' {
151
147
  * have not been called the expected number of times.
152
148
  *
153
149
  * ```js
154
- * import assert from 'assert';
150
+ * import assert from 'node:assert';
155
151
  *
156
152
  * // Creates call tracker.
157
153
  * const tracker = new assert.CallTracker();
@@ -193,7 +189,7 @@ declare module 'assert' {
193
189
  * it will be thrown instead of the `AssertionError`.
194
190
  *
195
191
  * ```js
196
- * import assert from 'assert/strict';
192
+ * import assert from 'node:assert/strict';
197
193
  *
198
194
  * assert.fail();
199
195
  * // AssertionError [ERR_ASSERTION]: Failed
@@ -231,7 +227,7 @@ declare module 'assert' {
231
227
  * thrown in a file! See below for further details.
232
228
  *
233
229
  * ```js
234
- * import assert from 'assert/strict';
230
+ * import assert from 'node:assert/strict';
235
231
  *
236
232
  * assert.ok(true);
237
233
  * // OK
@@ -266,7 +262,7 @@ declare module 'assert' {
266
262
  * ```
267
263
  *
268
264
  * ```js
269
- * import assert from 'assert/strict';
265
+ * import assert from 'node:assert/strict';
270
266
  *
271
267
  * // Using `assert()` works the same:
272
268
  * assert(0);
@@ -291,7 +287,7 @@ declare module 'assert' {
291
287
  * and treated as being identical if both sides are `NaN`.
292
288
  *
293
289
  * ```js
294
- * import assert from 'assert';
290
+ * import assert from 'node:assert';
295
291
  *
296
292
  * assert.equal(1, 1);
297
293
  * // OK, 1 == 1
@@ -324,7 +320,7 @@ declare module 'assert' {
324
320
  * specially handled and treated as being identical if both sides are `NaN`.
325
321
  *
326
322
  * ```js
327
- * import assert from 'assert';
323
+ * import assert from 'node:assert';
328
324
  *
329
325
  * assert.notEqual(1, 2);
330
326
  * // OK
@@ -371,24 +367,24 @@ declare module 'assert' {
371
367
  * Tests for any deep inequality. Opposite of {@link deepEqual}.
372
368
  *
373
369
  * ```js
374
- * import assert from 'assert';
370
+ * import assert from 'node:assert';
375
371
  *
376
372
  * const obj1 = {
377
373
  * a: {
378
- * b: 1
379
- * }
374
+ * b: 1,
375
+ * },
380
376
  * };
381
377
  * const obj2 = {
382
378
  * a: {
383
- * b: 2
384
- * }
379
+ * b: 2,
380
+ * },
385
381
  * };
386
382
  * const obj3 = {
387
383
  * a: {
388
- * b: 1
389
- * }
384
+ * b: 1,
385
+ * },
390
386
  * };
391
- * const obj4 = Object.create(obj1);
387
+ * const obj4 = { __proto__: obj1 };
392
388
  *
393
389
  * assert.notDeepEqual(obj1, obj1);
394
390
  * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
@@ -414,7 +410,7 @@ declare module 'assert' {
414
410
  * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
415
411
  *
416
412
  * ```js
417
- * import assert from 'assert/strict';
413
+ * import assert from 'node:assert/strict';
418
414
  *
419
415
  * assert.strictEqual(1, 2);
420
416
  * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
@@ -452,7 +448,7 @@ declare module 'assert' {
452
448
  * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
453
449
  *
454
450
  * ```js
455
- * import assert from 'assert/strict';
451
+ * import assert from 'node:assert/strict';
456
452
  *
457
453
  * assert.notStrictEqual(1, 2);
458
454
  * // OK
@@ -483,7 +479,7 @@ declare module 'assert' {
483
479
  * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
484
480
  *
485
481
  * ```js
486
- * import assert from 'assert/strict';
482
+ * import assert from 'node:assert/strict';
487
483
  *
488
484
  * assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
489
485
  * // OK
@@ -514,14 +510,14 @@ declare module 'assert' {
514
510
  * Custom validation object/error instance:
515
511
  *
516
512
  * ```js
517
- * import assert from 'assert/strict';
513
+ * import assert from 'node:assert/strict';
518
514
  *
519
515
  * const err = new TypeError('Wrong value');
520
516
  * err.code = 404;
521
517
  * err.foo = 'bar';
522
518
  * err.info = {
523
519
  * nested: true,
524
- * baz: 'text'
520
+ * baz: 'text',
525
521
  * };
526
522
  * err.reg = /abc/i;
527
523
  *
@@ -534,16 +530,16 @@ declare module 'assert' {
534
530
  * message: 'Wrong value',
535
531
  * info: {
536
532
  * nested: true,
537
- * baz: 'text'
538
- * }
533
+ * baz: 'text',
534
+ * },
539
535
  * // Only properties on the validation object will be tested for.
540
536
  * // Using nested objects requires all properties to be present. Otherwise
541
537
  * // the validation is going to fail.
542
- * }
538
+ * },
543
539
  * );
544
540
  *
545
541
  * // Using regular expressions to validate error properties:
546
- * throws(
542
+ * assert.throws(
547
543
  * () => {
548
544
  * throw err;
549
545
  * },
@@ -557,17 +553,17 @@ declare module 'assert' {
557
553
  * info: {
558
554
  * nested: true,
559
555
  * // It is not possible to use regular expressions for nested properties!
560
- * baz: 'text'
556
+ * baz: 'text',
561
557
  * },
562
558
  * // The `reg` property contains a regular expression and only if the
563
559
  * // validation object contains an identical regular expression, it is going
564
560
  * // to pass.
565
- * reg: /abc/i
566
- * }
561
+ * reg: /abc/i,
562
+ * },
567
563
  * );
568
564
  *
569
565
  * // Fails due to the different `message` and `name` properties:
570
- * throws(
566
+ * assert.throws(
571
567
  * () => {
572
568
  * const otherErr = new Error('Not found');
573
569
  * // Copy all enumerable properties from `err` to `otherErr`.
@@ -578,20 +574,20 @@ declare module 'assert' {
578
574
  * },
579
575
  * // The error's `message` and `name` properties will also be checked when using
580
576
  * // an error as validation object.
581
- * err
577
+ * err,
582
578
  * );
583
579
  * ```
584
580
  *
585
581
  * Validate instanceof using constructor:
586
582
  *
587
583
  * ```js
588
- * import assert from 'assert/strict';
584
+ * import assert from 'node:assert/strict';
589
585
  *
590
586
  * assert.throws(
591
587
  * () => {
592
588
  * throw new Error('Wrong value');
593
589
  * },
594
- * Error
590
+ * Error,
595
591
  * );
596
592
  * ```
597
593
  *
@@ -601,13 +597,13 @@ declare module 'assert' {
601
597
  * therefore also include the error name.
602
598
  *
603
599
  * ```js
604
- * import assert from 'assert/strict';
600
+ * import assert from 'node:assert/strict';
605
601
  *
606
602
  * assert.throws(
607
603
  * () => {
608
604
  * throw new Error('Wrong value');
609
605
  * },
610
- * /^Error: Wrong value$/
606
+ * /^Error: Wrong value$/,
611
607
  * );
612
608
  * ```
613
609
  *
@@ -617,7 +613,7 @@ declare module 'assert' {
617
613
  * It will otherwise fail with an `AssertionError`.
618
614
  *
619
615
  * ```js
620
- * import assert from 'assert/strict';
616
+ * import assert from 'node:assert/strict';
621
617
  *
622
618
  * assert.throws(
623
619
  * () => {
@@ -633,7 +629,7 @@ declare module 'assert' {
633
629
  * // possible.
634
630
  * return true;
635
631
  * },
636
- * 'unexpected error'
632
+ * 'unexpected error',
637
633
  * );
638
634
  * ```
639
635
  *
@@ -643,7 +639,7 @@ declare module 'assert' {
643
639
  * a string as the second argument gets considered:
644
640
  *
645
641
  * ```js
646
- * import assert from 'assert/strict';
642
+ * import assert from 'node:assert/strict';
647
643
  *
648
644
  * function throwingFirst() {
649
645
  * throw new Error('First');
@@ -699,20 +695,20 @@ declare module 'assert' {
699
695
  * propagated back to the caller.
700
696
  *
701
697
  * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
702
- * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation
698
+ * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation
703
699
  * function. See {@link throws} for more details.
704
700
  *
705
701
  * The following, for instance, will throw the `TypeError` because there is no
706
702
  * matching error type in the assertion:
707
703
  *
708
704
  * ```js
709
- * import assert from 'assert/strict';
705
+ * import assert from 'node:assert/strict';
710
706
  *
711
707
  * assert.doesNotThrow(
712
708
  * () => {
713
709
  * throw new TypeError('Wrong value');
714
710
  * },
715
- * SyntaxError
711
+ * SyntaxError,
716
712
  * );
717
713
  * ```
718
714
  *
@@ -720,27 +716,27 @@ declare module 'assert' {
720
716
  * 'Got unwanted exception...':
721
717
  *
722
718
  * ```js
723
- * import assert from 'assert/strict';
719
+ * import assert from 'node:assert/strict';
724
720
  *
725
721
  * assert.doesNotThrow(
726
722
  * () => {
727
723
  * throw new TypeError('Wrong value');
728
724
  * },
729
- * TypeError
725
+ * TypeError,
730
726
  * );
731
727
  * ```
732
728
  *
733
729
  * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message:
734
730
  *
735
731
  * ```js
736
- * import assert from 'assert/strict';
732
+ * import assert from 'node:assert/strict';
737
733
  *
738
734
  * assert.doesNotThrow(
739
735
  * () => {
740
736
  * throw new TypeError('Wrong value');
741
737
  * },
742
738
  * /Wrong value/,
743
- * 'Whoops'
739
+ * 'Whoops',
744
740
  * );
745
741
  * // Throws: AssertionError: Got unwanted exception: Whoops
746
742
  * ```
@@ -754,7 +750,7 @@ declare module 'assert' {
754
750
  * from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
755
751
  *
756
752
  * ```js
757
- * import assert from 'assert/strict';
753
+ * import assert from 'node:assert/strict';
758
754
  *
759
755
  * assert.ifError(null);
760
756
  * // OK
@@ -800,7 +796,7 @@ declare module 'assert' {
800
796
  * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
801
797
  *
802
798
  * ```js
803
- * import assert from 'assert/strict';
799
+ * import assert from 'node:assert/strict';
804
800
  *
805
801
  * await assert.rejects(
806
802
  * async () => {
@@ -808,13 +804,13 @@ declare module 'assert' {
808
804
  * },
809
805
  * {
810
806
  * name: 'TypeError',
811
- * message: 'Wrong value'
812
- * }
807
+ * message: 'Wrong value',
808
+ * },
813
809
  * );
814
810
  * ```
815
811
  *
816
812
  * ```js
817
- * import assert from 'assert/strict';
813
+ * import assert from 'node:assert/strict';
818
814
  *
819
815
  * await assert.rejects(
820
816
  * async () => {
@@ -824,16 +820,16 @@ declare module 'assert' {
824
820
  * assert.strictEqual(err.name, 'TypeError');
825
821
  * assert.strictEqual(err.message, 'Wrong value');
826
822
  * return true;
827
- * }
823
+ * },
828
824
  * );
829
825
  * ```
830
826
  *
831
827
  * ```js
832
- * import assert from 'assert/strict';
828
+ * import assert from 'node:assert/strict';
833
829
  *
834
830
  * assert.rejects(
835
831
  * Promise.reject(new Error('Wrong value')),
836
- * Error
832
+ * Error,
837
833
  * ).then(() => {
838
834
  * // ...
839
835
  * });
@@ -863,24 +859,24 @@ declare module 'assert' {
863
859
  * error messages as expressive as possible.
864
860
  *
865
861
  * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
866
- * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation
862
+ * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation
867
863
  * function. See {@link throws} for more details.
868
864
  *
869
865
  * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}.
870
866
  *
871
867
  * ```js
872
- * import assert from 'assert/strict';
868
+ * import assert from 'node:assert/strict';
873
869
  *
874
870
  * await assert.doesNotReject(
875
871
  * async () => {
876
872
  * throw new TypeError('Wrong value');
877
873
  * },
878
- * SyntaxError
874
+ * SyntaxError,
879
875
  * );
880
876
  * ```
881
877
  *
882
878
  * ```js
883
- * import assert from 'assert/strict';
879
+ * import assert from 'node:assert/strict';
884
880
  *
885
881
  * assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
886
882
  * .then(() => {
@@ -895,7 +891,7 @@ declare module 'assert' {
895
891
  * Expects the `string` input to match the regular expression.
896
892
  *
897
893
  * ```js
898
- * import assert from 'assert/strict';
894
+ * import assert from 'node:assert/strict';
899
895
  *
900
896
  * assert.match('I will fail', /pass/);
901
897
  * // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
@@ -918,7 +914,7 @@ declare module 'assert' {
918
914
  * Expects the `string` input not to match the regular expression.
919
915
  *
920
916
  * ```js
921
- * import assert from 'assert/strict';
917
+ * import assert from 'node:assert/strict';
922
918
  *
923
919
  * assert.doesNotMatch('I will fail', /fail/);
924
920
  * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...