Skip to content

Commit 57f1510

Browse files
wip(docs): rename loadModule() options_ into options
1 parent 915cbc7 commit 57f1510

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ function defaultGetResource(pathCx : PathContext, options : Options) : Resource
109109
* ```
110110
*
111111
*/
112-
export async function loadModule(path : string, options_ : Options = throwNotDefined('options')) : Promise<ModuleExport> {
112+
export async function loadModule(path : string, options : Options = throwNotDefined('options')) : Promise<ModuleExport> {
113113

114114
const {
115115
moduleCache = Object.create(null),
116116
getFile = throwNotDefined('options.getFile()'),
117117
addStyle = throwNotDefined('options.addStyle()'),
118118
pathHandlers = defaultPathHandlers,
119119
getResource = defaultGetResource,
120-
} = options_;
120+
} = options;
121121

122122

123123
// TBD: remove this in v1.0
@@ -127,15 +127,15 @@ export async function loadModule(path : string, options_ : Options = throwNotDef
127127
return typeof res === 'object' ? res : { content: res, extname: pathHandlers.extname(path) };
128128
}
129129

130-
const options = {
130+
const normalizedOptions = {
131131
moduleCache,
132132
pathHandlers,
133133
getResource,
134-
...options_,
134+
...options,
135135
getFile: normalizedGetFile,
136136
};
137137

138-
return await loadModuleInternal( { refPath: '/', relPath: path }, options);
138+
return await loadModuleInternal( { refPath: '/', relPath: path }, normalizedOptions);
139139
}
140140

141141
/**

0 commit comments

Comments
 (0)