You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Drift/server/node_modules/ts-node/dist/cjs-resolve-filename-hook.j...

1 line
2.3 KiB
Plaintext

{"version":3,"file":"cjs-resolve-filename-hook.js","sourceRoot":"","sources":["../src/cjs-resolve-filename-hook.ts"],"names":[],"mappings":";;;AAmBA;;GAEG;AACH,SAAgB,qCAAqC,CAAC,aAAsB;IAC1E,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAmC,CAAC;IACnE,MAAM,uBAAuB,GAAG,MAAM,CAAC,gBAAgB,CAAC;IACxD,MAAM,iBAAiB,GAAG,aAAa,CAAC,OAAO,CAAC,4BAA4B,CAAC;IAC7E,IAAI,iBAAiB,EAAE;QACrB,MAAM,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;KAC5C;IACD,SAAS,gBAAgB,CAEvB,OAAe,EACf,MAAe,EACf,MAAgB,EAChB,OAAsC,EACtC,GAAG,IAAW;QAEd,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;YAC1B,OAAO,uBAAuB,CAAC,IAAI,CACjC,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,EACP,GAAG,IAAI,CACR,CAAC;QAEJ,uFAAuF;QACvF,8BAA8B;QAC9B,OAAO,uBAAuB,CAAC,IAAI,CACjC,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,EACP,GAAG,IAAI,CACR,CAAC;IACJ,CAAC;AACH,CAAC;AApCD,sFAoCC","sourcesContent":["import type Module = require('module');\nimport type { Service } from '.';\n\n/** @internal */\nexport type ModuleConstructorWithInternals = typeof Module & {\n _resolveFilename(\n request: string,\n parent?: Module,\n isMain?: boolean,\n options?: ModuleResolveFilenameOptions,\n ...rest: any[]\n ): string;\n _preloadModules(requests?: string[]): void;\n};\n\ninterface ModuleResolveFilenameOptions {\n paths?: Array<string>;\n}\n\n/**\n * @internal\n */\nexport function installCommonjsResolveHookIfNecessary(tsNodeService: Service) {\n const Module = require('module') as ModuleConstructorWithInternals;\n const originalResolveFilename = Module._resolveFilename;\n const shouldInstallHook = tsNodeService.options.experimentalResolverFeatures;\n if (shouldInstallHook) {\n Module._resolveFilename = _resolveFilename;\n }\n function _resolveFilename(\n this: any,\n request: string,\n parent?: Module,\n isMain?: boolean,\n options?: ModuleResolveFilenameOptions,\n ...rest: any[]\n ): string {\n if (!tsNodeService.enabled())\n return originalResolveFilename.call(\n this,\n request,\n parent,\n isMain,\n options,\n ...rest\n );\n\n // This is a stub to support other pull requests that will be merged in the near future\n // Right now, it does nothing.\n return originalResolveFilename.call(\n this,\n request,\n parent,\n isMain,\n options,\n ...rest\n );\n }\n}\n"]}