File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,28 @@ const {
21
21
} = require ( 'internal/modules/esm/utils' ) ;
22
22
let defaultResolve , defaultLoad , defaultLoadSync , importMetaInitializer ;
23
23
24
+ /**
25
+ * Generate a resolve cache (to store the final result of a resolve-chain for a particular module).
26
+ * @returns {import('./module_map.js').ResolveCache') }
27
+ */
24
28
function newResolveCache ( ) {
25
29
const { ResolveCache } = require ( 'internal/modules/esm/module_map' ) ;
26
30
return new ResolveCache ( ) ;
27
31
}
28
32
33
+ /**
34
+ * Generate a load cache (to store the final result of a load-chain for a particular module).
35
+ * @returns {import('./module_map.js').LoadCache') }
36
+ */
29
37
function newLoadCache ( ) {
30
38
const { LoadCache } = require ( 'internal/modules/esm/module_map' ) ;
31
39
return new LoadCache ( ) ;
32
40
}
33
41
42
+ /**
43
+ * Lazy-load translators to avoid potentially unnecessary work at startup (ex if ESM is not used).
44
+ * @returns {import('./translators.js').Translators }
45
+ */
34
46
function getTranslators ( ) {
35
47
const { translators } = require ( 'internal/modules/esm/translators' ) ;
36
48
return translators ;
You can’t perform that action at this time.
0 commit comments