-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherr-no-icu.ts
More file actions
80 lines (74 loc) · 1.73 KB
/
err-no-icu.ts
File metadata and controls
80 lines (74 loc) · 1.73 KB
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
/**
* @file Errors - ERR_NO_ICU
* @module errnode/errors/ERR_NO_ICU
* @see https://github.com/nodejs/node/blob/v22.8.0/lib/internal/errors.js#L1605-L1606
*/
import E from '#e'
import { codes } from '#src/enums'
import type {
NodeError,
NodeErrorConstructor,
Stringifiable
} from '#src/interfaces'
/**
* `ERR_NO_ICU` schema.
*
* @see {@linkcode NodeError}
* @see https://nodejs.org/api/errors.html#err_no_icu
*
* @extends {NodeError<codes.ERR_NO_ICU>}
* @extends {TypeError}
*/
interface ErrNoIcu extends NodeError<codes.ERR_NO_ICU>, TypeError {}
/**
* `ERR_NO_ICU` message arguments.
*
* @see {@linkcode Stringifiable}
*/
type Args = [feature: Stringifiable]
/**
* `ERR_NO_ICU` constructor.
*
* @see {@linkcode ErrNoIcu}
* @see {@linkcode NodeErrorConstructor}
*
* @extends {NodeErrorConstructor<ErrNoIcu,Args>}
*/
interface ErrNoIcuConstructor extends NodeErrorConstructor<ErrNoIcu, Args> {
/**
* Create a new `ERR_NO_ICU` error.
*
* @see {@linkcode ErrNoIcu}
* @see {@linkcode Stringifiable}
*
* @param {Stringifiable} feature
* Description of feature that requires ICU
* @return {ErrNoIcu}
*/
new (feature: Stringifiable): ErrNoIcu
}
/**
* `ERR_NO_ICU` model.
*
* Thrown when an attempt was made to use features that require [ICU][icu], but
* Node.js was not compiled with ICU support.
*
* [icu]: https://nodejs.org/api/intl.html#internationalization-support
*
* @see {@linkcode ErrNoIcuConstructor}
*
* @type {ErrNoIcuConstructor}
*
* @class
*/
const ERR_NO_ICU: ErrNoIcuConstructor = E(
codes.ERR_NO_ICU,
TypeError,
'%s is not supported on Node.js compiled without ICU'
)
export {
ERR_NO_ICU as default,
type ErrNoIcu,
type Args as ErrNoIcuArgs,
type ErrNoIcuConstructor
}