diff options
author | Marvin Hagemeister <marvin@deno.com> | 2024-08-09 14:25:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-09 14:25:33 +0200 |
commit | f474c4f4ff2db301573a228fba0b65f9f4970f8c (patch) | |
tree | 85169a01584662c3c524e564a2e73bb3fe88d9a6 /ext/node/polyfills/01_require.js | |
parent | fc023038424f3de81d7dd66c68634024a5b29eed (diff) |
fix: stub `node:module.register()` (#24965)
This is commonly used to register loading non standard file types. But
some libs also register TS loaders which Deno supports natively, like
the npm `payload` package. This PR unblocks those.
Fixes https://github.com/denoland/deno/issues/24902
Diffstat (limited to 'ext/node/polyfills/01_require.js')
-rw-r--r-- | ext/node/polyfills/01_require.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index f71e009ba..1636edcb4 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -1293,6 +1293,19 @@ export function findSourceMap(_path) { return undefined; } +/** + * @param {string | URL} _specifier + * @param {string | URL} _parentUrl + * @param {{ parentURL: string | URL, data: any, transferList: any[] }} [_options] + */ +export function register(_specifier, _parentUrl, _options) { + // TODO(@marvinhagemeister): Stub implementation for programs registering + // TypeScript loaders. We don't support registering loaders for file + // types that Deno itself doesn't support at the moment. + + return undefined; +} + export { builtinModules, createRequire, isBuiltin, Module }; export const _cache = Module._cache; export const _extensions = Module._extensions; |