-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherr-unsupported-dir-import.ts
81 lines (75 loc) · 2.06 KB
/
err-unsupported-dir-import.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
/**
* @file Errors - ERR_UNSUPPORTED_DIR_IMPORT
* @module errnode/errors/ERR_UNSUPPORTED_DIR_IMPORT
* @see https://github.com/nodejs/node/blob/v22.7.0/lib/internal/errors.js#L1822-L1826
*/
import E from '#e'
import { codes } from '#src/enums'
import type {
NodeError,
NodeErrorConstructor,
Stringifiable
} from '#src/interfaces'
/**
* `ERR_UNSUPPORTED_DIR_IMPORT` schema.
*
* @see {@linkcode NodeError}
* @see https://nodejs.org/api/errors.html#err_unsupported_dir_import
*
* @extends {NodeError<codes.ERR_UNSUPPORTED_DIR_IMPORT>}
*/
interface ErrUnsupportedDirImport
extends NodeError<codes.ERR_UNSUPPORTED_DIR_IMPORT> {}
/**
* `ERR_UNSUPPORTED_DIR_IMPORT` message arguments.
*
* @see {@linkcode Stringifiable}
*/
type Args = [id: Stringifiable, base: Stringifiable]
/**
* `ERR_UNSUPPORTED_DIR_IMPORT` constructor.
*
* @see {@linkcode Args}
* @see {@linkcode ErrUnsupportedDirImport}
* @see {@linkcode NodeErrorConstructor}
*
* @extends {NodeErrorConstructor<ErrUnsupportedDirImport,Args>}
*/
interface ErrUnsupportedDirImportConstructor
extends NodeErrorConstructor<ErrUnsupportedDirImport, Args> {
/**
* Create a new `ERR_UNSUPPORTED_DIR_IMPORT` error.
*
* @see {@linkcode ErrUnsupportedDirImport}
* @see {@linkcode Stringifiable}
*
* @param {Stringifiable} id
* Directory id
* @param {Stringifiable} base
* Parent module id
* @return {ErrUnsupportedDirImport}
*/
new (id: Stringifiable, base: Stringifiable): ErrUnsupportedDirImport
}
/**
* `ERR_UNSUPPORTED_DIR_IMPORT` model.
*
* Thrown when a directory URL is `import`ed.
*
* @see {@linkcode ErrUnsupportedDirImportConstructor}
*
* @type {ErrUnsupportedDirImportConstructor}
*
* @class
*/
const ERR_UNSUPPORTED_DIR_IMPORT: ErrUnsupportedDirImportConstructor = E(
codes.ERR_UNSUPPORTED_DIR_IMPORT,
Error,
'Directory import \'%s\' is not supported resolving ES modules imported from %s'
)
export {
ERR_UNSUPPORTED_DIR_IMPORT as default,
type ErrUnsupportedDirImport,
type Args as ErrUnsupportedDirImportArgs,
type ErrUnsupportedDirImportConstructor
}