-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherr-invalid-tuple.ts
86 lines (80 loc) · 2.12 KB
/
err-invalid-tuple.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
* @file Errors - ERR_INVALID_TUPLE
* @module errnode/errors/ERR_INVALID_TUPLE
* @see https://github.com/nodejs/node/blob/v22.8.0/lib/internal/errors.js#L1530
*/
import E from '#e'
import { codes } from '#src/enums'
import type {
NodeError,
NodeErrorConstructor,
Stringifiable
} from '#src/interfaces'
/**
* `ERR_INVALID_TUPLE` schema.
*
* @see {@linkcode NodeError}
* @see https://nodejs.org/api/errors.html#err_invalid_tuple
*
* @extends {NodeError<codes.ERR_INVALID_TUPLE>}
* @extends {TypeError}
*/
interface ErrInvalidTuple
extends NodeError<codes.ERR_INVALID_TUPLE>, TypeError {}
/**
* `ERR_INVALID_TUPLE` message arguments.
*
* @see {@linkcode Stringifiable}
*/
type Args = [description: Stringifiable, tuple: Stringifiable]
/**
* `ERR_INVALID_TUPLE` constructor.
*
* @see {@linkcode ErrInvalidTuple}
* @see {@linkcode NodeErrorConstructor}
*
* @extends {NodeErrorConstructor<ErrInvalidTuple,Args>}
*/
interface ErrInvalidTupleConstructor
extends NodeErrorConstructor<ErrInvalidTuple, Args> {
/**
* Create a new `ERR_INVALID_TUPLE` error.
*
* @see {@linkcode ErrInvalidTuple}
* @see {@linkcode Stringifiable}
*
* @param {Stringifiable} description
* Description of required tuple
* @param {Stringifiable} tuple
* String representation of tuple
* @return {ErrInvalidTuple}
*/
new (description: Stringifiable, tuple: Stringifiable): ErrInvalidTuple
}
/**
* `ERR_INVALID_TUPLE` model.
*
* Thrown when an element in the iterable provided to the [WHATWG][whatwg]
* [`URLSearchParams` constructor][constructor] did not represent a
* `[name, value]` tuple.
*
* [constructor]: https://nodejs.org/api/url.html#new-urlsearchparamsiterable
* [whatwg]: https://nodejs.org/api/url.html#the-whatwg-url-api
*
* @see {@linkcode ErrInvalidTupleConstructor}
*
* @type {ErrInvalidTupleConstructor}
*
* @class
*/
const ERR_INVALID_TUPLE: ErrInvalidTupleConstructor = E(
codes.ERR_INVALID_TUPLE,
TypeError,
'%s must be an iterable %s tuple'
)
export {
ERR_INVALID_TUPLE as default,
type ErrInvalidTuple,
type Args as ErrInvalidTupleArgs,
type ErrInvalidTupleConstructor
}