Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c42ae39

Browse files
committedJan 24, 2022
lib: replace validator and error
Refs: #41660
1 parent 3657c14 commit c42ae39

File tree

79 files changed

+676
-198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+676
-198
lines changed
 

‎doc/api/crypto.md

+65
Original file line numberDiff line numberDiff line change
@@ -2869,6 +2869,12 @@ This property is deprecated. Please use `crypto.setFips()` and
28692869

28702870
<!-- YAML
28712871
added: v15.8.0
2872+
changes:
2873+
- version: REPLACEME
2874+
pr-url: https://github.com/nodejs/node/pull/41678
2875+
description: Passing an invalid callback to the `callback` argument
2876+
now throws `ERR_INVALID_ARG_TYPE` instead of
2877+
`ERR_INVALID_CALLBACK`.
28722878
-->
28732879

28742880
* `candidate` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}
@@ -3547,6 +3553,12 @@ Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`
35473553

35483554
<!-- YAML
35493555
added: v15.0.0
3556+
changes:
3557+
- version: REPLACEME
3558+
pr-url: https://github.com/nodejs/node/pull/41678
3559+
description: Passing an invalid callback to the `callback` argument
3560+
now throws `ERR_INVALID_ARG_TYPE` instead of
3561+
`ERR_INVALID_CALLBACK`.
35503562
-->
35513563

35523564
* `type`: {string} The intended use of the generated secret key. Currently
@@ -3592,6 +3604,11 @@ generateKey('hmac', { length: 64 }, (err, key) => {
35923604
<!-- YAML
35933605
added: v10.12.0
35943606
changes:
3607+
- version: REPLACEME
3608+
pr-url: https://github.com/nodejs/node/pull/41678
3609+
description: Passing an invalid callback to the `callback` argument
3610+
now throws `ERR_INVALID_ARG_TYPE` instead of
3611+
`ERR_INVALID_CALLBACK`.
35953612
- version: v16.10.0
35963613
pr-url: https://github.com/nodejs/node/pull/39927
35973614
description: Add ability to define `RSASSA-PSS-params` sequence parameters
@@ -3852,6 +3869,12 @@ console.log(key.export().toString('hex')); // e89..........41e
38523869

38533870
<!-- YAML
38543871
added: v15.8.0
3872+
changes:
3873+
- version: REPLACEME
3874+
pr-url: https://github.com/nodejs/node/pull/41678
3875+
description: Passing an invalid callback to the `callback` argument
3876+
now throws `ERR_INVALID_ARG_TYPE` instead of
3877+
`ERR_INVALID_CALLBACK`.
38553878
-->
38563879

38573880
* `size` {number} The size (in bits) of the prime to generate.
@@ -4118,6 +4141,12 @@ A convenient alias for [`crypto.webcrypto.getRandomValues()`][].
41184141

41194142
<!-- YAML
41204143
added: v15.0.0
4144+
changes:
4145+
- version: REPLACEME
4146+
pr-url: https://github.com/nodejs/node/pull/41678
4147+
description: Passing an invalid callback to the `callback` argument
4148+
now throws `ERR_INVALID_ARG_TYPE` instead of
4149+
`ERR_INVALID_CALLBACK`.
41214150
-->
41224151

41234152
* `digest` {string} The digest algorithm to use.
@@ -4221,6 +4250,11 @@ console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653'
42214250
<!-- YAML
42224251
added: v0.5.5
42234252
changes:
4253+
- version: REPLACEME
4254+
pr-url: https://github.com/nodejs/node/pull/41678
4255+
description: Passing an invalid callback to the `callback` argument
4256+
now throws `ERR_INVALID_ARG_TYPE` instead of
4257+
`ERR_INVALID_CALLBACK`.
42244258
- version: v15.0.0
42254259
pr-url: https://github.com/nodejs/node/pull/35093
42264260
description: The password and salt arguments can also be ArrayBuffer
@@ -4602,6 +4636,11 @@ be passed instead of a public key.
46024636
<!-- YAML
46034637
added: v0.5.8
46044638
changes:
4639+
- version: REPLACEME
4640+
pr-url: https://github.com/nodejs/node/pull/41678
4641+
description: Passing an invalid callback to the `callback` argument
4642+
now throws `ERR_INVALID_ARG_TYPE` instead of
4643+
`ERR_INVALID_CALLBACK`.
46054644
- version: v9.0.0
46064645
pr-url: https://github.com/nodejs/node/pull/16454
46074646
description: Passing `null` as the `callback` argument now throws
@@ -4782,6 +4821,11 @@ added:
47824821
- v7.10.0
47834822
- v6.13.0
47844823
changes:
4824+
- version: REPLACEME
4825+
pr-url: https://github.com/nodejs/node/pull/41678
4826+
description: Passing an invalid callback to the `callback` argument
4827+
now throws `ERR_INVALID_ARG_TYPE` instead of
4828+
`ERR_INVALID_CALLBACK`.
47854829
- version: v9.0.0
47864830
pr-url: https://github.com/nodejs/node/pull/15231
47874831
description: The `buffer` argument may be any `TypedArray` or `DataView`.
@@ -4918,6 +4962,12 @@ request.
49184962
added:
49194963
- v14.10.0
49204964
- v12.19.0
4965+
changes:
4966+
- version: REPLACEME
4967+
pr-url: https://github.com/nodejs/node/pull/41678
4968+
description: Passing an invalid callback to the `callback` argument
4969+
now throws `ERR_INVALID_ARG_TYPE` instead of
4970+
`ERR_INVALID_CALLBACK`.
49214971
-->
49224972

49234973
* `min` {integer} Start of random range (inclusive). **Default:** `0`.
@@ -5021,6 +5071,11 @@ cryptographic pseudorandom number generator.
50215071
<!-- YAML
50225072
added: v10.5.0
50235073
changes:
5074+
- version: REPLACEME
5075+
pr-url: https://github.com/nodejs/node/pull/41678
5076+
description: Passing an invalid callback to the `callback` argument
5077+
now throws `ERR_INVALID_ARG_TYPE` instead of
5078+
`ERR_INVALID_CALLBACK`.
50245079
- version: v15.0.0
50255080
pr-url: https://github.com/nodejs/node/pull/35093
50265081
description: The password and salt arguments can also be ArrayBuffer
@@ -5244,6 +5299,11 @@ Throws an error if FIPS mode is not available.
52445299
<!-- YAML
52455300
added: v12.0.0
52465301
changes:
5302+
- version: REPLACEME
5303+
pr-url: https://github.com/nodejs/node/pull/41678
5304+
description: Passing an invalid callback to the `callback` argument
5305+
now throws `ERR_INVALID_ARG_TYPE` instead of
5306+
`ERR_INVALID_CALLBACK`.
52475307
- version: v15.12.0
52485308
pr-url: https://github.com/nodejs/node/pull/37500
52495309
description: Optional callback argument added.
@@ -5340,6 +5400,11 @@ not introduce timing vulnerabilities.
53405400
<!-- YAML
53415401
added: v12.0.0
53425402
changes:
5403+
- version: REPLACEME
5404+
pr-url: https://github.com/nodejs/node/pull/41678
5405+
description: Passing an invalid callback to the `callback` argument
5406+
now throws `ERR_INVALID_ARG_TYPE` instead of
5407+
`ERR_INVALID_CALLBACK`.
53435408
- version: v15.12.0
53445409
pr-url: https://github.com/nodejs/node/pull/37500
53455410
description: Optional callback argument added.

‎doc/api/deprecations.md

+17
Original file line numberDiff line numberDiff line change
@@ -3056,6 +3056,22 @@ This method was deprecated because it is not compatible with
30563056

30573057
Use [`buffer.subarray`][] which does the same thing instead.
30583058

3059+
### DEP0159: `ERR_INVALID_CALLBACK`
3060+
3061+
<!-- YAML
3062+
changes:
3063+
- version: REPLACEME
3064+
pr-url: https://github.com/nodejs/node/pull/41678
3065+
description: End-of-Life.
3066+
-->
3067+
3068+
Type: End-of-Life
3069+
3070+
This error was removed due to adding more confusion to
3071+
the errors used for value type validation.
3072+
3073+
Use [`ERR_INVALID_ARG_TYPE`][] instead.
3074+
30593075
[Legacy URL API]: url.md#legacy-url-api
30603076
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
30613077
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -3070,6 +3086,7 @@ Use [`buffer.subarray`][] which does the same thing instead.
30703086
[`Buffer.isBuffer()`]: buffer.md#static-method-bufferisbufferobj
30713087
[`Cipher`]: crypto.md#class-cipher
30723088
[`Decipher`]: crypto.md#class-decipher
3089+
[`ERR_INVALID_ARG_TYPE`]: errors.md#err_invalid_arg_type
30733090
[`REPLServer.clearBufferedCommand()`]: repl.md#replserverclearbufferedcommand
30743091
[`ReadStream.open()`]: fs.md#class-fsreadstream
30753092
[`Server.getConnections()`]: net.md#servergetconnectionscallback

0 commit comments

Comments
 (0)
Please sign in to comment.