From 9f997e6d7290bff5d49101dde10130e3da7b74b4 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Fri, 27 Oct 2023 10:53:21 +0200 Subject: [PATCH] Fix @mdx-js/loader types The code was fine, but was affected by a TypeScript bug. https://github.com/microsoft/TypeScript/issues/56229 --- packages/loader/index.cjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/loader/index.cjs b/packages/loader/index.cjs index a5a1e9201..5cb7bf698 100644 --- a/packages/loader/index.cjs +++ b/packages/loader/index.cjs @@ -19,10 +19,12 @@ * @returns {undefined} * Nothing. */ -module.exports = function (code) { +function loader(code) { const callback = this.async() // Note that `import()` caches, so this should be fast enough. import('./lib/index.js').then((module) => { return module.loader.call(this, code, callback) }) } + +module.exports = loader