Skip to content

Commit 7a99c1c

Browse files
simplify createTranspilingRequire function signature
1 parent 9483079 commit 7a99c1c

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

packages/jest-transform/src/ScriptTransformer.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -845,21 +845,13 @@ class ScriptTransformer {
845845
}
846846
}
847847

848-
// TODO: do we need to define the generics twice?
849-
export async function createTranspilingRequire(
850-
config: Config.ProjectConfig,
851-
): Promise<
852-
<TModuleType = unknown>(
853-
resolverPath: string,
854-
applyInteropRequireDefault?: boolean,
855-
) => Promise<TModuleType>
856-
> {
848+
export async function createTranspilingRequire(config: Config.ProjectConfig) {
857849
const transformer = await createScriptTransformer(config);
858850

859851
return async function requireAndTranspileModule<TModuleType = unknown>(
860852
resolverPath: string,
861853
applyInteropRequireDefault = false,
862-
) {
854+
): Promise<TModuleType> {
863855
const transpiledModule =
864856
await transformer.requireAndTranspileModule<TModuleType>(
865857
resolverPath,

0 commit comments

Comments
 (0)