-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherr-unsupported-resolve-request.ts
94 lines (88 loc) · 2.78 KB
/
err-unsupported-resolve-request.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
87
88
89
90
91
92
93
94
/**
* @file Errors - ERR_UNSUPPORTED_RESOLVE_REQUEST
* @module errnode/errors/ERR_UNSUPPORTED_RESOLVE_REQUEST
* @see https://github.com/nodejs/node/blob/v22.7.0/lib/internal/errors.js#L1839-L1841
*/
import E from '#e'
import { codes } from '#src/enums'
import type {
NodeError,
NodeErrorConstructor,
Stringifiable
} from '#src/interfaces'
/**
* `ERR_UNSUPPORTED_RESOLVE_REQUEST` schema.
*
* @see {@linkcode NodeError}
* @see https://nodejs.org/api/errors.html#err_unsupported_resolve_request
*
* @extends {NodeError<codes.ERR_UNSUPPORTED_RESOLVE_REQUEST>}
* @extends {TypeError}
*/
interface ErrUnsupportedResolveRequest
extends NodeError<codes.ERR_UNSUPPORTED_RESOLVE_REQUEST>, TypeError {}
/**
* `ERR_UNSUPPORTED_RESOLVE_REQUEST` message arguments.
*
* @see {@linkcode Stringifiable}
*/
type Args = [specifier: Stringifiable, base: Stringifiable]
/**
* `ERR_UNSUPPORTED_RESOLVE_REQUEST` constructor.
*
* @see {@linkcode Args}
* @see {@linkcode ErrUnsupportedResolveRequest}
* @see {@linkcode NodeErrorConstructor}
*
* @extends {NodeErrorConstructor<ErrUnsupportedResolveRequest,Args>}
*/
interface ErrUnsupportedResolveRequestConstructor
extends NodeErrorConstructor<ErrUnsupportedResolveRequest, Args> {
/**
* Create a new `ERR_UNSUPPORTED_RESOLVE_REQUEST` error.
*
* @see {@linkcode ErrUnsupportedResolveRequest}
* @see {@linkcode Stringifiable}
*
* @param {Stringifiable} specifier
* The module specifier that failed to resolve
* @param {Stringifiable} base
* Parent module id
* @return {ErrUnsupportedResolveRequest}
*/
new (
specifier: Stringifiable,
base: Stringifiable
): ErrUnsupportedResolveRequest
}
/**
* `ERR_UNSUPPORTED_RESOLVE_REQUEST` model.
*
* Thrown when an attempt is made to resolve an invalid module referrer. This
* can happen when importing or calling `import.meta.resolve()` with either:
* - a bare specifier that is not a builtin module from a module whose URL
* scheme is not file.
* - a [relative URL][relative-url] from a module whose URL scheme is not a
* [special scheme][special-scheme].
*
* [relative-url]: https://url.spec.whatwg.org/#relative-url-string
* [special-scheme]: https://url.spec.whatwg.org/#special-scheme
*
* @see {@linkcode ErrUnsupportedResolveRequestConstructor}
*
* @type {ErrUnsupportedResolveRequestConstructor}
*
* @class
*/
const ERR_UNSUPPORTED_RESOLVE_REQUEST: ErrUnsupportedResolveRequestConstructor =
E(
codes.ERR_UNSUPPORTED_RESOLVE_REQUEST,
TypeError,
'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.'
)
export {
ERR_UNSUPPORTED_RESOLVE_REQUEST as default,
type ErrUnsupportedResolveRequest,
type Args as ErrUnsupportedResolveRequestArgs,
type ErrUnsupportedResolveRequestConstructor
}