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/index.js.map

1 line
81 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,+BAA2E;AAC3E,mCAAgC;AAChC,6BAA6B;AAC7B,6BAAoC;AAEpC,kEAAmE;AACnE,2CAAuC;AAIvC,iCAWgB;AAChB,mDAA6C;AAE7C,qEAGkC;AAClC,6DAA+D;AAE/D,2EAGqC;AAGrC,+BAKgB;AAJd,kGAAA,UAAU,OAAA;AAmBZ;;;GAGG;AACH,MAAM,8BAA8B,GAClC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAE1D,gBAAgB;AAChB,SAAgB,YAAY,CAC1B,OAAe,EACf,cAAsB,EACtB,aAAsB;IAEtB,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;IAC7D,MAAM,KAAK,GACT,KAAK,GAAG,QAAQ;QAChB,CAAC,KAAK,KAAK,QAAQ;YACjB,CAAC,KAAK,GAAG,QAAQ,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrE,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,IAAI,aAAa,EAAE;QACjB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,KAAK,CA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H,SAAS,iBAAiB,CACxB,WAAsC,EACtC,OAA2B;IAE3B,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAC9B,OAAO,CAAC,KAAK,CACX,CAAC,CAAC,EAAE,EAAE;;QACJ,OAAA,CAAC,CAAC,CAAC,CAAC,iBAAiB;YACnB,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,MAAA,CAAC,CAAC,IAAI,0CAAE,QAAS,CAAC,KAAK,CAAC,CAAC,CAAC;YACxD,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;KAAA,CAC9C,CACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,kBAAkB,CACzB,EAAY,EACZ,UAA0B,EAC1B,QAAgB;IAEhB,IAAI,OAAO,GAAa,UAAU,CAAC;IAEnC,KAAK,EAAE,OAAO,IAAI,EAAE;QAClB,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;YACnD,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;YACnC,IAAI,KAAK,GAAG,QAAQ;gBAAE,MAAM;YAE5B,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC3B,IAAI,QAAQ,IAAI,GAAG,EAAE;gBACnB,OAAO,GAAG,KAAK,CAAC;gBAChB,SAAS,KAAK,CAAC;aAChB;SACF;QAED,OAAO,OAAO,CAAC;KAChB;AACH,CAAC;AAED;;;;;;;;;GASG;AACI,MAAM,cAAc,GAA4B,CACrD,aAAsB,EACtB,EAAE,CAAE,OAAO,CAAC,OAAO,CAA4B,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;AAFnE,QAAA,cAAc,kBAEqD","sourcesContent":["import { relative, basename, extname, resolve, dirname, join } from 'path';\nimport { Module } from 'module';\nimport * as util from 'util';\nimport { fileURLToPath } from 'url';\n\nimport sourceMapSupport = require('@cspotcode/source-map-support');\nimport { BaseError } from 'make-error';\nimport type * as _ts from 'typescript';\n\nimport type { Transpiler, TranspilerFactory } from './transpilers/types';\nimport {\n assign,\n attemptRequireWithV8CompileCache,\n cachedLookup,\n createProjectLocalResolveHelper,\n getBasePathForProjectLocalDependencyResolution,\n normalizeSlashes,\n parse,\n ProjectLocalResolveHelper,\n split,\n yn,\n} from './util';\nimport { readConfig } from './configuration';\nimport type { TSCommon, TSInternal } from './ts-compiler-types';\nimport {\n createModuleTypeClassifier,\n ModuleTypeClassifier,\n} from './module-type-classifier';\nimport { createResolverFunctions } from './resolver-functions';\nimport type { createEsmHooks as createEsmHooksFn } from './esm';\nimport {\n installCommonjsResolveHookIfNecessary,\n ModuleConstructorWithInternals,\n} from './cjs-resolve-filename-hook';\n\nexport { TSCommon };\nexport {\n createRepl,\n CreateReplOptions,\n ReplService,\n EvalAwarePartialHost,\n} from './repl';\nexport type {\n TranspilerModule,\n TranspilerFactory,\n CreateTranspilerOptions,\n TranspileOutput,\n TranspileOptions,\n Transpiler,\n} from './transpilers/types';\nexport type {\n NodeLoaderHooksAPI1,\n NodeLoaderHooksAPI2,\n NodeLoaderHooksFormat,\n} from './esm';\n\n/**\n * Does this version of node obey the package.json \"type\" field\n * and throw ERR_REQUIRE_ESM when attempting to require() an ESM modules.\n */\nconst engineSupportsPackageTypeField =\n parseInt(process.versions.node.split('.')[0], 10) >= 12;\n\n/** @internal */\nexport function versionGteLt(\n version: string,\n gteRequirement: string,\n ltRequirement?: string\n) {\n const [major, minor, patch, extra] = parse(version);\n const [gteMajor, gteMinor, gtePatch] = parse(gteRequirement);\n const isGte =\n major > gteMajor ||\n (major === gteMajor &&\n (minor > gteMinor || (minor === gteMinor && patch >= gtePatch)));\n let isLt = true;\n if (ltRequirement) {\n const [ltMajor, ltMinor, ltPatch] = parse(ltRequirement);\n isLt =\n major < ltMajor ||\n (major === ltMajor &&\n (minor < ltMinor || (minor === ltMinor && patch < ltPatch)));\n }\n return isGte && isLt;\n\n function parse(requirement: string) {\n return requirement.split(/[\\.-]/).map((s) => parseInt(s, 10));\n }\n}\n\n/**\n * Assert that script can be loaded as CommonJS when we attempt to require it.\n * If it should be loaded as ESM, throw ERR_REQUIRE_ESM like node does.\n *\n * Loaded conditionally so we don't need to support older node versions\n */\nlet assertScriptCanLoadAsCJS: (\n service: Service,\n module: NodeJS.Module,\n filename: string\n) => void = engineSupportsPackageTypeField\n ? require('../dist-raw/node-cjs-loader-utils').assertScriptCanLoadAsCJSImpl\n : () => {\n /* noop */\n };\n\n/**\n * Registered `ts-node` instance information.\n */\nexport const REGISTER_INSTANCE = Symbol.for('ts-node.register.instance');\n\n/**\n * Expose `REGISTER_INSTANCE` information on node.js `process`.\n */\ndeclare global {\n namespace NodeJS {\n interface Process {\n [REGISTER_INSTANCE]?: Service;\n }\n }\n}\n\n/** @internal */\nexport const env = process.env as ProcessEnv;\n/**\n * Declare all env vars, to aid discoverability.\n * If an env var affects ts-node's behavior, it should not be buried somewhere in our codebase.\n * @internal\n */\nexport interface ProcessEnv {\n TS_NODE_DEBUG?: string;\n TS_NODE_CWD?: string;\n /** @deprecated */\n TS_NODE_DIR?: string;\n TS_NODE_EMIT?: string;\n TS_NODE_SCOPE?: string;\n TS_NODE_SCOPE_DIR?: string;\n TS_NODE_FILES?: string;\n TS_NODE_PRETTY?: string;\n TS_NODE_COMPILER?: string;\n TS_NODE_COMPILER_OPTIONS?: string;\n TS_NODE_IGNORE?: string;\n TS_NODE_PROJECT?: string;\n TS_NODE_SKIP_PROJECT?: string;\n TS_NODE_SKIP_IGNORE?: string;\n TS_NODE_PREFER_TS_EXTS?: string;\n TS_NODE_IGNORE_DIAGNOSTICS?: string;\n TS_NODE_TRANSPILE_ONLY?: string;\n TS_NODE_TYPE_CHECK?: string;\n TS_NODE_COMPILER_HOST?: string;\n TS_NODE_LOG_ERROR?: string;\n TS_NODE_HISTORY?: string;\n TS_NODE_EXPERIMENTAL_REPL_AWAIT?: string;\n\n NODE_NO_READLINE?: string;\n}\n\n/**\n * @internal\n */\nexport const INSPECT_CUSTOM = util.inspect.custom || 'inspect';\n\n/**\n * Debugging `ts-node`.\n */\nconst shouldDebug = yn(env.TS_NODE_DEBUG);\n/** @internal */\nexport const debug = shouldDebug\n ? (...args: any) =>\n console.log(`[ts-node ${new Date().toISOString()}]`, ...args)\n : () => undefined;\nconst debugFn = shouldDebug\n ? <T, U>(key: string, fn: (arg: T) => U) => {\n let i = 0;\n return (x: T) => {\n debug(key, x, ++i);\n return fn(x);\n };\n }\n : <T, U>(_: string, fn: (arg: T) => U) => fn;\n\n/**\n * Export the current version.\n */\nexport const VERSION = require('../package.json').version;\n\n/**\n * Options for creating a new TypeScript compiler instance.\n */\nexport interface CreateOptions {\n /**\n * Behave as if invoked within this working directory. Roughly equivalent to `cd $dir && ts-node ...`\n *\n * @default process.cwd()\n */\n cwd?: string;\n /**\n * Legacy alias for `cwd`\n *\n * @deprecated use `projectSearchDir` or `cwd`\n */\n dir?: string;\n /**\n * Emit output files into `.ts-node` directory.\n *\n * @default false\n */\n emit?: boolean;\n /**\n * Scope compiler to files within `scopeDir`.\n *\n * @default false\n */\n scope?: boolean;\n /**\n * @default First of: `tsconfig.json` \"rootDir\" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded.\n */\n scopeDir?: string;\n /**\n * Use pretty diagnostic formatter.\n *\n * @default false\n */\n pretty?: boolean;\n /**\n * Use TypeScript's faster `transpileModule`.\n *\n * @default false\n */\n transpileOnly?: boolean;\n /**\n * **DEPRECATED** Specify type-check is enabled (e.g. `transpileOnly == false`).\n *\n * @default true\n */\n typeCheck?: boolean;\n /**\n * Use TypeScript's compiler host API instead of the language service API.\n *\n * @default false\n */\n compilerHost?: boolean;\n /**\n * Logs TypeScript errors to stderr instead of throwing exceptions.\n *\n * @default false\n */\n logError?: boolean;\n /**\n * Load \"files\" and \"include\" from `tsconfig.json` on startup.\n *\n * Default is to override `tsconfig.json` \"files\" and \"include\" to only include the entrypoint script.\n *\n * @default false\n */\n files?: boolean;\n /**\n * Specify a custom TypeScript compiler.\n *\n * @default \"typescript\"\n */\n compiler?: string;\n /**\n * Specify a custom transpiler for use with transpileOnly\n */\n transpiler?: string | [string, object];\n /**\n * Transpile with swc instead of the TypeScript compiler, and skip typechecking.\n *\n * Equivalent to setting both `transpileOnly: true` and `transpiler: 'ts-node/transpilers/swc'`\n *\n * For complete instructions: https://typestrong.org/ts-node/docs/transpilers\n */\n swc?: boolean;\n /**\n * Paths which should not be compiled.\n *\n * Each string in the array is converted to a regular expression via `new RegExp()` and tested against source paths prior to compilation.\n *\n * Source paths are normalized to posix-style separators, relative to the directory containing `tsconfig.json` or to cwd if no `tsconfig.json` is loaded.\n *\n * Default is to ignore all node_modules subdirectories.\n *\n * @default [\"(?:^|/)node_modules/\"]\n */\n ignore?: string[];\n /**\n * Path to TypeScript config file or directory containing a `tsconfig.json`.\n * Similar to the `tsc --project` flag: https://www.typescriptlang.org/docs/handbook/compiler-options.html\n */\n project?: string;\n /**\n * Search for TypeScript config file (`tsconfig.json`) in this or parent directories.\n */\n projectSearchDir?: string;\n /**\n * Skip project config resolution and loading.\n *\n * @default false\n */\n skipProject?: boolean;\n /**\n * Skip ignore check, so that compilation will be attempted for all files with matching extensions.\n *\n * @default false\n */\n skipIgnore?: boolean;\n /**\n * JSON object to merge with TypeScript `compilerOptions`.\n *\n * @allOf [{\"$ref\": \"https://schemastore.azurewebsites.net/schemas/json/tsconfig.json#definitions/compilerOptionsDefinition/properties/compilerOptions\"}]\n */\n compilerOptions?: object;\n /**\n * Ignore TypeScript warnings by diagnostic code.\n */\n ignoreDiagnostics?: Array<number | string>;\n /**\n * Modules to require, like node's `--require` flag.\n *\n * If specified in `tsconfig.json`, the modules will be resolved relative to the `tsconfig.json` file.\n *\n * If specified programmatically, each input string should be pre-resolved to an absolute path for\n * best results.\n */\n require?: Array<string>;\n readFile?: (path: string) => string | undefined;\n fileExists?: (path: string) => boolean;\n transformers?:\n | _ts.CustomTransformers\n | ((p: _ts.Program) => _ts.CustomTransformers);\n /**\n * Allows the usage of top level await in REPL.\n *\n * Uses node's implementation which accomplishes this with an AST syntax transformation.\n *\n * Enabled by default when tsconfig target is es2018 or above. Set to false to disable.\n *\n * **Note**: setting to `true` when tsconfig target is too low will throw an Error. Leave as `undefined`\n * to get default, automatic behavior.\n */\n experimentalReplAwait?: boolean;\n /**\n * Override certain paths to be compiled and executed as CommonJS or ECMAScript modules.\n * When overridden, the tsconfig \"module\" and package.json \"type\" fields are overridden.\n * This is useful because TypeScript files cannot use the .cjs nor .mjs file extensions;\n * it achieves the same effect.\n *\n * Each key is a glob pattern following the same rules as tsconfig's \"include\" array.\n * When multiple patterns match the same file, the last pattern takes precedence.\n *\n * `cjs` overrides matches files to compile and execute as CommonJS.\n * `esm` overrides matches files to compile and execute as native ECMAScript modules.\n * `package` overrides either of the above to default behavior, which obeys package.json \"type\" and\n * tsconfig.json \"module\" options.\n */\n moduleTypes?: ModuleTypes;\n /**\n * @internal\n * Set by our configuration loader whenever a config file contains options that\n * are relative to the config file they came from, *and* when other logic needs\n * to know this. Some options can be eagerly resolved to absolute paths by\n * the configuration loader, so it is *not* necessary for their source to be set here.\n */\n optionBasePaths?: OptionBasePaths;\n /**\n * A function to collect trace messages from the TypeScript compiler, for example when `traceResolution` is enabled.\n *\n * @default console.log\n */\n tsTrace?: (str: string) => void;\n}\n\nexport type ModuleTypes = Record<string, 'cjs' | 'esm' | 'package'>;\n\n/** @internal */\nexport interface OptionBasePaths {\n moduleTypes?: string;\n transpiler?: string;\n compiler?: string;\n}\n\n/**\n * Options for registering a TypeScript compiler instance globally.\n */\nexport interface RegisterOptions extends CreateOptions {\n /**\n * Re-order file extensions so that TypeScript imports are preferred.\n *\n * For example, when both `index.js` and `index.ts` exist, enabling this option causes `require('./index')` to resolve to `index.ts` instead of `index.js`\n *\n * @default false\n */\n preferTsExts?: boolean;\n\n /**\n * Enable experimental features that re-map imports and require calls to support:\n * `baseUrl`, `paths`, `rootDirs`, `.js` to `.ts` file extension mappings,\n * `outDir` to `rootDir` mappings for composite projects and monorepos.\n *\n * For details, see https://github.com/TypeStrong/ts-node/issues/1514\n */\n experimentalResolverFeatures?: boolean;\n}\n\n/**\n * Must be an interface to support `typescript-json-schema`.\n */\nexport interface TsConfigOptions\n extends Omit<\n RegisterOptions,\n | 'transformers'\n | 'readFile'\n | 'fileExists'\n | 'skipProject'\n | 'project'\n | 'dir'\n | 'cwd'\n | 'projectSearchDir'\n | 'optionBasePaths'\n | 'tsTrace'\n > {}\n\n/**\n * Information retrieved from type info check.\n */\nexport interface TypeInfo {\n name: string;\n comment: string;\n}\n\n/**\n * Default register options, including values specified via environment\n * variables.\n * @internal\n */\nexport const DEFAULTS: RegisterOptions = {\n cwd: env.TS_NODE_CWD ?? env.TS_NODE_DIR,\n emit: yn(env.TS_NODE_EMIT),\n scope: yn(env.TS_NODE_SCOPE),\n scopeDir: env.TS_NODE_SCOPE_DIR,\n files: yn(env.TS_NODE_FILES),\n pretty: yn(env.TS_NODE_PRETTY),\n compiler: env.TS_NODE_COMPILER,\n compilerOptions: parse(env.TS_NODE_COMPILER_OPTIONS),\n ignore: split(env.TS_NODE_IGNORE),\n project: env.TS_NODE_PROJECT,\n skipProject: yn(env.TS_NODE_SKIP_PROJECT),\n skipIgnore: yn(env.TS_NODE_SKIP_IGNORE),\n preferTsExts: yn(env.TS_NODE_PREFER_TS_EXTS),\n ignoreDiagnostics: split(env.TS_NODE_IGNORE_DIAGNOSTICS),\n transpileOnly: yn(env.TS_NODE_TRANSPILE_ONLY),\n typeCheck: yn(env.TS_NODE_TYPE_CHECK),\n compilerHost: yn(env.TS_NODE_COMPILER_HOST),\n logError: yn(env.TS_NODE_LOG_ERROR),\n experimentalReplAwait: yn(env.TS_NODE_EXPERIMENTAL_REPL_AWAIT) ?? undefined,\n tsTrace: console.log.bind(console),\n};\n\n/**\n * TypeScript diagnostics error.\n */\nexport class TSError extends BaseError {\n name = 'TSError';\n diagnosticText!: string;\n\n constructor(diagnosticText: string, public diagnosticCodes: number[]) {\n super(` Unable to compile TypeScript:\\n${diagnosticText}`);\n Object.defineProperty(this, 'diagnosticText', {\n configurable: true,\n writable: true,\n value: diagnosticText,\n });\n }\n\n /**\n * @internal\n */\n [INSPECT_CUSTOM]() {\n return this.diagnosticText;\n }\n}\n\nconst TS_NODE_SERVICE_BRAND = Symbol('TS_NODE_SERVICE_BRAND');\n\n/**\n * Primary ts-node service, which wraps the TypeScript API and can compile TypeScript to JavaScript\n */\nexport interface Service {\n /** @internal */\n [TS_NODE_SERVICE_BRAND]: true;\n ts: TSCommon;\n /** @internal */\n compilerPath: string;\n config: _ts.ParsedCommandLine;\n options: RegisterOptions;\n enabled(enabled?: boolean): boolean;\n ignored(fileName: string): boolean;\n compile(code: string, fileName: string, lineOffset?: number): string;\n getTypeInfo(code: string, fileName: string, position: number): TypeInfo;\n /** @internal */\n configFilePath: string | undefined;\n /** @internal */\n moduleTypeClassifier: ModuleTypeClassifier;\n /** @internal */\n readonly shouldReplAwait: boolean;\n /** @internal */\n addDiagnosticFilter(filter: DiagnosticFilter): void;\n /** @internal */\n installSourceMapSupport(): void;\n /** @internal */\n enableExperimentalEsmLoaderInterop(): void;\n /** @internal */\n transpileOnly: boolean;\n /** @internal */\n projectLocalResolveHelper: ProjectLocalResolveHelper;\n}\n\n/**\n * Re-export of `Service` interface for backwards-compatibility\n * @deprecated use `Service` instead\n * @see {Service}\n */\nexport type Register = Service;\n\n/** @internal */\nexport interface DiagnosticFilter {\n /** if true, filter applies to all files */\n appliesToAllFiles: boolean;\n /** Filter applies onto to these filenames. Only used if appliesToAllFiles is false */\n filenamesAbsolute: string[];\n /** these diagnostic codes are ignored */\n diagnosticsIgnored: number[];\n}\n\n/** @internal */\nexport function getExtensions(config: _ts.ParsedCommandLine) {\n const tsExtensions = ['.ts'];\n const jsExtensions = [];\n\n // Enable additional extensions when JSX or `allowJs` is enabled.\n if (config.options.jsx) tsExtensions.push('.tsx');\n if (config.options.allowJs) jsExtensions.push('.js');\n if (config.options.jsx && config.options.allowJs) jsExtensions.push('.jsx');\n return { tsExtensions, jsExtensions };\n}\n\n/**\n * Create a new TypeScript compiler instance and register it onto node.js\n */\nexport function register(opts?: RegisterOptions): Service;\n/**\n * Register TypeScript compiler instance onto node.js\n */\nexport function register(service: Service): Service;\nexport function register(\n serviceOrOpts: Service | RegisterOptions | undefined\n): Service {\n // Is this a Service or a RegisterOptions?\n let service = serviceOrOpts as Service;\n if (!(serviceOrOpts as Service)?.[TS_NODE_SERVICE_BRAND]) {\n // Not a service; is options\n service = create((serviceOrOpts ?? {}) as RegisterOptions);\n }\n\n const originalJsHandler = require.extensions['.js'];\n const { tsExtensions, jsExtensions } = getExtensions(service.config);\n const extensions = [...tsExtensions, ...jsExtensions];\n\n // Expose registered instance globally.\n process[REGISTER_INSTANCE] = service;\n\n // Register the extensions.\n registerExtensions(\n service.options.preferTsExts,\n extensions,\n service,\n originalJsHandler\n );\n\n installCommonjsResolveHookIfNecessary(service);\n\n // Require specified modules before start-up.\n (Module as ModuleConstructorWithInternals)._preloadModules(\n service.options.require\n );\n\n return service;\n}\n\n/**\n * Create TypeScript compiler instance.\n */\nexport function create(rawOptions: CreateOptions = {}): Service {\n const cwd = resolve(\n rawOptions.cwd ?? rawOptions.dir ?? DEFAULTS.cwd ?? process.cwd()\n );\n const compilerName = rawOptions.compiler ?? DEFAULTS.compiler;\n\n /**\n * Load the typescript compiler. It is required to load the tsconfig but might\n * be changed by the tsconfig, so we have to do this twice.\n */\n function loadCompiler(name: string | undefined, relativeToPath: string) {\n const projectLocalResolveHelper =\n createProjectLocalResolveHelper(relativeToPath);\n const compiler = projectLocalResolveHelper(name || 'typescript', true);\n const ts: TSCommon = attemptRequireWithV8CompileCache(require, compiler);\n return { compiler, ts, projectLocalResolveHelper };\n }\n\n // Compute minimum options to read the config file.\n let { compiler, ts, projectLocalResolveHelper } = loadCompiler(\n compilerName,\n getBasePathForProjectLocalDependencyResolution(\n undefined,\n rawOptions.projectSearchDir,\n rawOptions.project,\n cwd\n )\n );\n\n // Read config file and merge new options between env and CLI options.\n const { configFilePath, config, tsNodeOptionsFromTsconfig, optionBasePaths } =\n readConfig(cwd, ts, rawOptions);\n const options = assign<RegisterOptions>(\n {},\n DEFAULTS,\n tsNodeOptionsFromTsconfig || {},\n { optionBasePaths },\n rawOptions\n );\n options.require = [\n ...(tsNodeOptionsFromTsconfig.require || []),\n ...(rawOptions.require || []),\n ];\n\n // Re-load the compiler in case it has changed.\n // Compiler is loaded relative to tsconfig.json, so tsconfig discovery may cause us to load a\n // different compiler than we did above, even if the name has not changed.\n if (configFilePath) {\n ({ compiler, ts, projectLocalResolveHelper } = loadCompiler(\n options.compiler,\n getBasePathForProjectLocalDependencyResolution(\n configFilePath,\n rawOptions.projectSearchDir,\n rawOptions.project,\n cwd\n )\n ));\n }\n\n // Experimental REPL await is not compatible targets lower than ES2018\n const targetSupportsTla = config.options.target! >= ts.ScriptTarget.ES2018;\n if (options.experimentalReplAwait === true && !targetSupportsTla) {\n throw new Error(\n 'Experimental REPL await is not compatible with targets lower than ES2018'\n );\n }\n // Top-level await was added in TS 3.8\n const tsVersionSupportsTla = versionGteLt(ts.version, '3.8.0');\n if (options.experimentalReplAwait === true && !tsVersionSupportsTla) {\n throw new Error(\n 'Experimental REPL await is not compatible with TypeScript versions older than 3.8'\n );\n }\n\n const shouldReplAwait =\n options.experimentalReplAwait !== false &&\n tsVersionSupportsTla &&\n targetSupportsTla;\n\n // swc implies two other options\n // typeCheck option was implemented specifically to allow overriding tsconfig transpileOnly from the command-line\n // So we should allow using typeCheck to override swc\n if (options.swc && !options.typeCheck) {\n if (options.transpileOnly === false) {\n throw new Error(\n \"Cannot enable 'swc' option with 'transpileOnly: false'. 'swc' implies 'transpileOnly'.\"\n );\n }\n if (options.transpiler) {\n throw new Error(\n \"Cannot specify both 'swc' and 'transpiler' options. 'swc' uses the built-in swc transpiler.\"\n );\n }\n }\n\n const readFile = options.readFile || ts.sys.readFile;\n const fileExists = options.fileExists || ts.sys.fileExists;\n // typeCheck can override transpileOnly, useful for CLI flag to override config file\n const transpileOnly =\n (options.transpileOnly === true || options.swc === true) &&\n options.typeCheck !== true;\n const transpiler = options.transpiler\n ? options.transpiler\n : options.swc\n ? require.resolve('./transpilers/swc.js')\n : undefined;\n const transformers = options.transformers || undefined;\n const diagnosticFilters: Array<DiagnosticFilter> = [\n {\n appliesToAllFiles: true,\n filenamesAbsolute: [],\n diagnosticsIgnored: [\n 6059, // \"'rootDir' is expected to contain all source files.\"\n 18002, // \"The 'files' list in config file is empty.\"\n 18003, // \"No inputs were found in config file.\"\n ...(options.ignoreDiagnostics || []),\n ].map(Number),\n },\n ];\n\n const configDiagnosticList = filterDiagnostics(\n config.errors,\n diagnosticFilters\n );\n const outputCache = new Map<\n string,\n {\n content: string;\n }\n >();\n\n const configFileDirname = configFilePath ? dirname(configFilePath) : null;\n const scopeDir =\n options.scopeDir ?? config.options.rootDir ?? configFileDirname ?? cwd;\n const ignoreBaseDir = configFileDirname ?? cwd;\n const isScoped = options.scope\n ? (fileName: string) => relative(scopeDir, fileName).charAt(0) !== '.'\n : () => true;\n const shouldIgnore = createIgnore(\n ignoreBaseDir,\n options.skipIgnore\n ? []\n : (options.ignore || ['(?:^|/)node_modules/']).map(\n (str) => new RegExp(str)\n )\n );\n\n const diagnosticHost: _ts.FormatDiagnosticsHost = {\n getNewLine: () => ts.sys.newLine,\n getCurrentDirectory: () => cwd,\n getCanonicalFileName: ts.sys.useCaseSensitiveFileNames\n ? (x) => x\n : (x) => x.toLowerCase(),\n };\n\n if (options.transpileOnly && typeof transformers === 'function') {\n throw new TypeError(\n 'Transformers function is unavailable in \"--transpile-only\"'\n );\n }\n let createTranspiler:\n | ((compilerOptions: TSCommon.CompilerOptions) => Transpiler)\n | undefined;\n if (transpiler) {\n if (!transpileOnly)\n throw new Error(\n 'Custom transpiler can only be used when transpileOnly is enabled.'\n );\n const transpilerName =\n typeof transpiler === 'string' ? transpiler : transpiler[0];\n const transpilerOptions =\n typeof transpiler === 'string' ? {} : transpiler[1] ?? {};\n const transpilerPath = projectLocalResolveHelper(transpilerName, true);\n const transpilerFactory = require(transpilerPath)\n .create as TranspilerFactory;\n createTranspiler = function (compilerOptions) {\n return transpilerFactory({\n service: {\n options,\n config: {\n ...config,\n options: compilerOptions,\n },\n projectLocalResolveHelper,\n },\n ...transpilerOptions,\n });\n };\n }\n\n /**\n * True if require() hooks should interop with experimental ESM loader.\n * Enabled explicitly via a flag since it is a breaking change.\n */\n let experimentalEsmLoader = false;\n function enableExperimentalEsmLoaderInterop() {\n experimentalEsmLoader = true;\n }\n\n // Install source map support and read from memory cache.\n installSourceMapSupport();\n function installSourceMapSupport() {\n sourceMapSupport.install({\n environment: 'node',\n retrieveFile(pathOrUrl: string) {\n let path = pathOrUrl;\n // If it's a file URL, convert to local path\n // Note: fileURLToPath does not exist on early node v10\n // I could not find a way to handle non-URLs except to swallow an error\n if (experimentalEsmLoader && path.startsWith('file://')) {\n try {\n path = fileURLToPath(path);\n } catch (e) {\n /* swallow error */\n }\n }\n path = normalizeSlashes(path);\n return outputCache.get(path)?.content || '';\n },\n redirectConflictingLibrary: true,\n onConflictingLibraryRedirect(\n request,\n parent,\n isMain,\n options,\n redirectedRequest\n ) {\n debug(\n `Redirected an attempt to require source-map-support to instead receive @cspotcode/source-map-support. \"${\n (parent as NodeJS.Module).filename\n }\" attempted to require or resolve \"${request}\" and was redirected to \"${redirectedRequest}\".`\n );\n },\n });\n }\n\n const shouldHavePrettyErrors =\n options.pretty === undefined ? process.stdout.isTTY : options.pretty;\n\n const formatDiagnostics = shouldHavePrettyErrors\n ? ts.formatDiagnosticsWithColorAndContext || ts.formatDiagnostics\n : ts.formatDiagnostics;\n\n function createTSError(diagnostics: ReadonlyArray<_ts.Diagnostic>) {\n const diagnosticText = formatDiagnostics(diagnostics, diagnosticHost);\n const diagnosticCodes = diagnostics.map((x) => x.code);\n return new TSError(diagnosticText, diagnosticCodes);\n }\n\n function reportTSError(configDiagnosticList: _ts.Diagnostic[]) {\n const error = createTSError(configDiagnosticList);\n if (options.logError) {\n // Print error in red color and continue execution.\n console.error('\\x1b[31m%s\\x1b[0m', error);\n } else {\n // Throw error and exit the script.\n throw error;\n }\n }\n\n // Render the configuration errors.\n if (configDiagnosticList.length) reportTSError(configDiagnosticList);\n\n /**\n * Get the extension for a transpiled file.\n */\n const getExtension =\n config.options.jsx === ts.JsxEmit.Preserve\n ? (path: string) => (/\\.[tj]sx$/.test(path) ? '.jsx' : '.js')\n : (_: string) => '.js';\n\n type GetOutputFunction = (code: string, fileName: string) => SourceOutput;\n /**\n * Create the basic required function using transpile mode.\n */\n let getOutput: GetOutputFunction;\n let getTypeInfo: (\n _code: string,\n _fileName: string,\n _position: number\n ) => TypeInfo;\n\n const getCanonicalFileName = (\n ts as unknown as TSInternal\n ).createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames);\n\n const moduleTypeClassifier = createModuleTypeClassifier({\n basePath: options.optionBasePaths?.moduleTypes,\n patterns: options.moduleTypes,\n });\n\n // Use full language services when the fast option is disabled.\n if (!transpileOnly) {\n const fileContents = new Map<string, string>();\n const rootFileNames = new Set(config.fileNames);\n const cachedReadFile = cachedLookup(debugFn('readFile', readFile));\n\n // Use language services by default (TODO: invert next major version).\n if (!options.compilerHost) {\n let projectVersion = 1;\n const fileVersions = new Map(\n Array.from(rootFileNames).map((fileName) => [fileName, 0])\n );\n\n const getCustomTransformers = () => {\n if (typeof transformers === 'function') {\n const program = service.getProgram();\n return program ? transformers(program) : undefined;\n }\n\n return transformers;\n };\n\n // Create the compiler host for type checking.\n const serviceHost: _ts.LanguageServiceHost &\n Required<Pick<_ts.LanguageServiceHost, 'fileExists' | 'readFile'>> = {\n getProjectVersion: () => String(projectVersion),\n getScriptFileNames: () => Array.from(rootFileNames),\n getScriptVersion: (fileName: string) => {\n const version = fileVersions.get(fileName);\n return version ? version.toString() : '';\n },\n getScriptSnapshot(fileName: string) {\n // TODO ordering of this with getScriptVersion? Should they sync up?\n let contents = fileContents.get(fileName);\n\n // Read contents into TypeScript memory cache.\n if (contents === undefined) {\n contents = cachedReadFile(fileName);\n if (contents === undefined) return;\n\n fileVersions.set(fileName, 1);\n fileContents.set(fileName, contents);\n projectVersion++;\n }\n\n return ts.ScriptSnapshot.fromString(contents);\n },\n readFile: cachedReadFile,\n readDirectory: ts.sys.readDirectory,\n getDirectories: cachedLookup(\n debugFn('getDirectories', ts.sys.getDirectories)\n ),\n fileExists: cachedLookup(debugFn('fileExists', fileExists)),\n directoryExists: cachedLookup(\n debugFn('directoryExists', ts.sys.directoryExists)\n ),\n realpath: ts.sys.realpath\n ? cachedLookup(debugFn('realpath', ts.sys.realpath))\n : undefined,\n getNewLine: () => ts.sys.newLine,\n useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames,\n getCurrentDirectory: () => cwd,\n getCompilationSettings: () => config.options,\n getDefaultLibFileName: () => ts.getDefaultLibFilePath(config.options),\n getCustomTransformers: getCustomTransformers,\n trace: options.tsTrace,\n };\n const {\n resolveModuleNames,\n getResolvedModuleWithFailedLookupLocationsFromCache,\n resolveTypeReferenceDirectives,\n isFileKnownToBeInternal,\n markBucketOfFilenameInternal,\n } = createResolverFunctions({\n host: serviceHost,\n getCanonicalFileName,\n ts,\n cwd,\n config,\n projectLocalResolveHelper,\n });\n serviceHost.resolveModuleNames = resolveModuleNames;\n serviceHost.getResolvedModuleWithFailedLookupLocationsFromCache =\n getResolvedModuleWithFailedLookupLocationsFromCache;\n serviceHost.resolveTypeReferenceDirectives =\n resolveTypeReferenceDirectives;\n\n const registry = ts.createDocumentRegistry(\n ts.sys.useCaseSensitiveFileNames,\n cwd\n );\n const service = ts.createLanguageService(serviceHost, registry);\n\n const updateMemoryCache = (contents: string, fileName: string) => {\n // Add to `rootFiles` as necessary, either to make TS include a file it has not seen,\n // or to trigger a re-classification of files from external to internal.\n if (\n !rootFileNames.has(fileName) &&\n !isFileKnownToBeInternal(fileName)\n ) {\n markBucketOfFilenameInternal(fileName);\n rootFileNames.add(fileName);\n // Increment project version for every change to rootFileNames.\n projectVersion++;\n }\n\n const previousVersion = fileVersions.get(fileName) || 0;\n const previousContents = fileContents.get(fileName);\n // Avoid incrementing cache when nothing has changed.\n if (contents !== previousContents) {\n fileVersions.set(fileName, previousVersion + 1);\n fileContents.set(fileName, contents);\n // Increment project version for every file change.\n projectVersion++;\n }\n };\n\n let previousProgram: _ts.Program | undefined = undefined;\n\n getOutput = (code: string, fileName: string) => {\n updateMemoryCache(code, fileName);\n\n const programBefore = service.getProgram();\n if (programBefore !== previousProgram) {\n debug(\n `compiler rebuilt Program instance when getting output for ${fileName}`\n );\n }\n\n const output = service.getEmitOutput(fileName);\n\n // Get the relevant diagnostics - this is 3x faster than `getPreEmitDiagnostics`.\n const diagnostics = service\n .getSemanticDiagnostics(fileName)\n .concat(service.getSyntacticDiagnostics(fileName));\n\n const programAfter = service.getProgram();\n\n debug(\n 'invariant: Is service.getProject() identical before and after getting emit output and diagnostics? (should always be true) ',\n programBefore === programAfter\n );\n\n previousProgram = programAfter;\n\n const diagnosticList = filterDiagnostics(\n diagnostics,\n diagnosticFilters\n );\n if (diagnosticList.length) reportTSError(diagnosticList);\n\n if (output.emitSkipped) {\n return [undefined, undefined, true];\n }\n\n // Throw an error when requiring `.d.ts` files.\n if (output.outputFiles.length === 0) {\n throw new TypeError(\n `Unable to require file: ${relative(cwd, fileName)}\\n` +\n 'This is usually the result of a faulty configuration or import. ' +\n 'Make sure there is a `.js`, `.json` or other executable extension with ' +\n 'loader attached before `ts-node` available.'\n );\n }\n\n return [output.outputFiles[1].text, output.outputFiles[0].text, false];\n };\n\n getTypeInfo = (code: string, fileName: string, position: number) => {\n updateMemoryCache(code, fileName);\n\n const info = service.getQuickInfoAtPosition(fileName, position);\n const name = ts.displayPartsToString(info ? info.displayParts : []);\n const comment = ts.displayPartsToString(info ? info.documentation : []);\n\n return { name, comment };\n };\n } else {\n const sys: _ts.System & _ts.FormatDiagnosticsHost = {\n ...ts.sys,\n ...diagnosticHost,\n readFile: (fileName: string) => {\n const cacheContents = fileContents.get(fileName);\n if (cacheContents !== undefined) return cacheContents;\n const contents = cachedReadFile(fileName);\n if (contents) fileContents.set(fileName, contents);\n return contents;\n },\n readDirectory: ts.sys.readDirectory,\n getDirectories: cachedLookup(\n debugFn('getDirectories', ts.sys.getDirectories)\n ),\n fileExists: cachedLookup(debugFn('fileExists', fileExists)),\n directoryExists: cachedLookup(\n debugFn('directoryExists', ts.sys.directoryExists)\n ),\n resolvePath: cachedLookup(debugFn('resolvePath', ts.sys.resolvePath)),\n realpath: ts.sys.realpath\n ? cachedLookup(debugFn('realpath', ts.sys.realpath))\n : undefined,\n };\n\n const host: _ts.CompilerHost = ts.createIncrementalCompilerHost\n ? ts.createIncrementalCompilerHost(config.options, sys)\n : {\n ...sys,\n getSourceFile: (fileName, languageVersion) => {\n const contents = sys.readFile(fileName);\n if (contents === undefined) return;\n return ts.createSourceFile(fileName, contents, languageVersion);\n },\n getDefaultLibLocation: () => normalizeSlashes(dirname(compiler)),\n getDefaultLibFileName: () =>\n normalizeSlashes(\n join(\n dirname(compiler),\n ts.getDefaultLibFileName(config.options)\n )\n ),\n useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames,\n };\n host.trace = options.tsTrace;\n const {\n resolveModuleNames,\n resolveTypeReferenceDirectives,\n isFileKnownToBeInternal,\n markBucketOfFilenameInternal,\n } = createResolverFunctions({\n host,\n cwd,\n config,\n ts,\n getCanonicalFileName,\n projectLocalResolveHelper,\n });\n host.resolveModuleNames = resolveModuleNames;\n host.resolveTypeReferenceDirectives = resolveTypeReferenceDirectives;\n\n // Fallback for older TypeScript releases without incremental API.\n let builderProgram = ts.createIncrementalProgram\n ? ts.createIncrementalProgram({\n rootNames: Array.from(rootFileNames),\n options: config.options,\n host,\n configFileParsingDiagnostics: config.errors,\n projectReferences: config.projectReferences,\n })\n : ts.createEmitAndSemanticDiagnosticsBuilderProgram(\n Array.from(rootFileNames),\n config.options,\n host,\n undefined,\n config.errors,\n config.projectReferences\n );\n\n // Read and cache custom transformers.\n const customTransformers =\n typeof transformers === 'function'\n ? transformers(builderProgram.getProgram())\n : transformers;\n\n // Set the file contents into cache manually.\n const updateMemoryCache = (contents: string, fileName: string) => {\n const previousContents = fileContents.get(fileName);\n const contentsChanged = previousContents !== contents;\n if (contentsChanged) {\n fileContents.set(fileName, contents);\n }\n\n // Add to `rootFiles` when discovered by compiler for the first time.\n let addedToRootFileNames = false;\n if (\n !rootFileNames.has(fileName) &&\n !isFileKnownToBeInternal(fileName)\n ) {\n markBucketOfFilenameInternal(fileName);\n rootFileNames.add(fileName);\n addedToRootFileNames = true;\n }\n\n // Update program when file changes.\n if (addedToRootFileNames || contentsChanged) {\n builderProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram(\n Array.from(rootFileNames),\n config.options,\n host,\n builderProgram,\n config.errors,\n config.projectReferences\n );\n }\n };\n\n getOutput = (code: string, fileName: string) => {\n let outText = '';\n let outMap = '';\n\n updateMemoryCache(code, fileName);\n\n const sourceFile = builderProgram.getSourceFile(fileName);\n if (!sourceFile)\n throw new TypeError(`Unable to read file: ${fileName}`);\n\n const program = builderProgram.getProgram();\n const diagnostics = ts.getPreEmitDiagnostics(program, sourceFile);\n const diagnosticList = filterDiagnostics(\n diagnostics,\n diagnosticFilters\n );\n if (diagnosticList.length) reportTSError(diagnosticList);\n\n const result = builderProgram.emit(\n sourceFile,\n (path, file, writeByteOrderMark) => {\n if (path.endsWith('.map')) {\n outMap = file;\n } else {\n outText = file;\n }\n\n if (options.emit) sys.writeFile(path, file, writeByteOrderMark);\n },\n undefined,\n undefined,\n customTransformers\n );\n\n if (result.emitSkipped) {\n return [undefined, undefined, true];\n }\n\n // Throw an error when requiring files that cannot be compiled.\n if (outText === '') {\n if (program.isSourceFileFromExternalLibrary(sourceFile)) {\n throw new TypeError(\n `Unable to compile file from external library: ${relative(\n cwd,\n fileName\n )}`\n );\n }\n\n throw new TypeError(\n `Unable to require file: ${relative(cwd, fileName)}\\n` +\n 'This is usually the result of a faulty configuration or import. ' +\n 'Make sure there is a `.js`, `.json` or other executable extension with ' +\n 'loader attached before `ts-node` available.'\n );\n }\n\n return [outText, outMap, false];\n };\n\n getTypeInfo = (code: string, fileName: string, position: number) => {\n updateMemoryCache(code, fileName);\n\n const sourceFile = builderProgram.getSourceFile(fileName);\n if (!sourceFile)\n throw new TypeError(`Unable to read file: ${fileName}`);\n\n const node = getTokenAtPosition(ts, sourceFile, position);\n const checker = builderProgram.getProgram().getTypeChecker();\n const symbol = checker.getSymbolAtLocation(node);\n\n if (!symbol) return { name: '', comment: '' };\n\n const type = checker.getTypeOfSymbolAtLocation(symbol, node);\n const signatures = [\n ...type.getConstructSignatures(),\n ...type.getCallSignatures(),\n ];\n\n return {\n name: signatures.length\n ? signatures.map((x) => checker.signatureToString(x)).join('\\n')\n : checker.typeToString(type),\n comment: ts.displayPartsToString(\n symbol ? symbol.getDocumentationComment(checker) : []\n ),\n };\n };\n\n // Write `.tsbuildinfo` when `--build` is enabled.\n if (options.emit && config.options.incremental) {\n process.on('exit', () => {\n // Emits `.tsbuildinfo` to filesystem.\n (builderProgram.getProgram() as any).emitBuildInfo();\n });\n }\n }\n } else {\n getOutput = createTranspileOnlyGetOutputFunction();\n\n getTypeInfo = () => {\n throw new TypeError(\n 'Type information is unavailable in \"--transpile-only\"'\n );\n };\n }\n\n function createTranspileOnlyGetOutputFunction(\n overrideModuleType?: _ts.ModuleKind\n ): GetOutputFunction {\n const compilerOptions = { ...config.options };\n if (overrideModuleType !== undefined)\n compilerOptions.module = overrideModuleType;\n let customTranspiler = createTranspiler?.(compilerOptions);\n return (code: string, fileName: string): SourceOutput => {\n let result: _ts.TranspileOutput;\n if (customTranspiler) {\n result = customTranspiler.transpile(code, {\n fileName,\n });\n } else {\n result = ts.transpileModule(code, {\n fileName,\n compilerOptions,\n reportDiagnostics: true,\n transformers: transformers as _ts.CustomTransformers | undefined,\n });\n }\n\n const diagnosticList = filterDiagnostics(\n result.diagnostics || [],\n diagnosticFilters\n );\n if (diagnosticList.length) reportTSError(diagnosticList);\n\n return [result.outputText, result.sourceMapText as string, false];\n };\n }\n\n // When either is undefined, it means normal `getOutput` should be used\n const getOutputForceCommonJS =\n config.options.module === ts.ModuleKind.CommonJS\n ? undefined\n : createTranspileOnlyGetOutputFunction(ts.ModuleKind.CommonJS);\n // [MUST_UPDATE_FOR_NEW_MODULEKIND]\n const getOutputForceESM =\n config.options.module === ts.ModuleKind.ES2015 ||\n (ts.ModuleKind.ES2020 && config.options.module === ts.ModuleKind.ES2020) ||\n (ts.ModuleKind.ES2022 && config.options.module === ts.ModuleKind.ES2022) ||\n config.options.module === ts.ModuleKind.ESNext\n ? undefined\n : // [MUST_UPDATE_FOR_NEW_MODULEKIND]\n createTranspileOnlyGetOutputFunction(\n ts.ModuleKind.ES2022 || ts.ModuleKind.ES2020 || ts.ModuleKind.ES2015\n );\n const getOutputTranspileOnly = createTranspileOnlyGetOutputFunction();\n\n // Create a simple TypeScript compiler proxy.\n function compile(code: string, fileName: string, lineOffset = 0) {\n const normalizedFileName = normalizeSlashes(fileName);\n const classification =\n moduleTypeClassifier.classifyModule(normalizedFileName);\n // Must always call normal getOutput to throw typechecking errors\n let [value, sourceMap, emitSkipped] = getOutput(code, normalizedFileName);\n // If module classification contradicts the above, call the relevant transpiler\n if (classification.moduleType === 'cjs' && getOutputForceCommonJS) {\n [value, sourceMap] = getOutputForceCommonJS(code, normalizedFileName);\n } else if (classification.moduleType === 'esm' && getOutputForceESM) {\n [value, sourceMap] = getOutputForceESM(code, normalizedFileName);\n } else if (emitSkipped) {\n [value, sourceMap] = getOutputTranspileOnly(code, normalizedFileName);\n }\n const output = updateOutput(\n value!,\n normalizedFileName,\n sourceMap!,\n getExtension\n );\n outputCache.set(normalizedFileName, { content: output });\n return output;\n }\n\n let active = true;\n const enabled = (enabled?: boolean) =>\n enabled === undefined ? active : (active = !!enabled);\n const extensions = getExtensions(config);\n const ignored = (fileName: string) => {\n if (!active) return true;\n const ext = extname(fileName);\n if (\n extensions.tsExtensions.includes(ext) ||\n extensions.jsExtensions.includes(ext)\n ) {\n return !isScoped(fileName) || shouldIgnore(fileName);\n }\n return true;\n };\n\n function addDiagnosticFilter(filter: DiagnosticFilter) {\n diagnosticFilters.push({\n ...filter,\n filenamesAbsolute: filter.filenamesAbsolute.map((f) =>\n normalizeSlashes(f)\n ),\n });\n }\n\n return {\n [TS_NODE_SERVICE_BRAND]: true,\n ts,\n compilerPath: compiler,\n config,\n compile,\n getTypeInfo,\n ignored,\n enabled,\n options,\n configFilePath,\n moduleTypeClassifier,\n shouldReplAwait,\n addDiagnosticFilter,\n installSourceMapSupport,\n enableExperimentalEsmLoaderInterop,\n transpileOnly,\n projectLocalResolveHelper,\n };\n}\n\n/**\n * Check if the filename should be ignored.\n */\nfunction createIgnore(ignoreBaseDir: string, ignore: RegExp[]) {\n return (fileName: string) => {\n const relname = relative(ignoreBaseDir, fileName);\n const path = normalizeSlashes(relname);\n\n return ignore.some((x) => x.test(path));\n };\n}\n\n/**\n * \"Refreshes\" an extension on `require.extensions`.\n *\n * @param {string} ext\n */\nfunction reorderRequireExtension(ext: string) {\n const old = require.extensions[ext];\n delete require.extensions[ext];\n require.extensions[ext] = old;\n}\n\n/**\n * Register the extensions to support when importing files.\n */\nfunction registerExtensions(\n preferTsExts: boolean | null | undefined,\n extensions: string[],\n service: Service,\n originalJsHandler: (m: NodeModule, filename: string) => any\n) {\n // Register new extensions.\n for (const ext of extensions) {\n registerExtension(ext, service, originalJsHandler);\n }\n\n if (preferTsExts) {\n const preferredExtensions = new Set([\n ...extensions,\n ...Object.keys(require.extensions),\n ]);\n\n for (const ext of preferredExtensions) reorderRequireExtension(ext);\n }\n}\n\n/**\n * Register the extension for node.\n */\nfunction registerExtension(\n ext: string,\n service: Service,\n originalHandler: (m: NodeModule, filename: string) => any\n) {\n const old = require.extensions[ext] || originalHandler;\n\n require.extensions[ext] = function (m: any, filename) {\n if (service.ignored(filename)) return old(m, filename);\n\n assertScriptCanLoadAsCJS(service, m, filename);\n\n const _compile = m._compile;\n\n m._compile = function (code: string, fileName: string) {\n debug('module._compile', fileName);\n\n const result = service.compile(code, fileName);\n return _compile.call(this, result, fileName);\n };\n\n return old(m, filename);\n };\n}\n\n/**\n * Internal source output.\n */\ntype SourceOutput = [string, string, false] | [undefined, undefined, true];\n\n/**\n * Update the output remapping the source map.\n */\nfunction updateOutput(\n outputText: string,\n fileName: string,\n sourceMap: string,\n getExtension: (fileName: string) => string\n) {\n const base64Map = Buffer.from(\n updateSourceMap(sourceMap, fileName),\n 'utf8'\n ).toString('base64');\n const sourceMapContent = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${base64Map}`;\n // Expected form: `//# sourceMappingURL=foo bar.js.map` or `//# sourceMappingURL=foo%20bar.js.map` for input file \"foo bar.tsx\"\n // Percent-encoding behavior added in TS 4.1.1: https://github.com/microsoft/TypeScript/issues/40951\n const prefix = '//# sourceMappingURL=';\n const prefixLength = prefix.length;\n const baseName = /*foo.tsx*/ basename(fileName);\n const extName = /*.tsx*/ extname(fileName);\n const extension = /*.js*/ getExtension(fileName);\n const sourcemapFilename =\n baseName.slice(0, -extName.length) + extension + '.map';\n const sourceMapLengthWithoutPercentEncoding =\n prefixLength + sourcemapFilename.length;\n /*\n * Only rewrite if existing directive exists at the location we expect, to support:\n * a) compilers that do not append a sourcemap directive\n * b) situations where we did the math wrong\n * Not ideal, but appending our sourcemap *after* a pre-existing sourcemap still overrides, so the end-user is happy.\n */\n if (\n outputText.substr(-sourceMapLengthWithoutPercentEncoding, prefixLength) ===\n prefix\n ) {\n return (\n outputText.slice(0, -sourceMapLengthWithoutPercentEncoding) +\n sourceMapContent\n );\n }\n // If anyone asks why we're not using URL, the URL equivalent is: `u = new URL('http://d'); u.pathname = \"/\" + sourcemapFilename; return u.pathname.slice(1);\n const sourceMapLengthWithPercentEncoding =\n prefixLength + encodeURI(sourcemapFilename).length;\n if (\n outputText.substr(-sourceMapLengthWithPercentEncoding, prefixLength) ===\n prefix\n ) {\n return (\n outputText.slice(0, -sourceMapLengthWithPercentEncoding) +\n sourceMapContent\n );\n }\n\n return `${outputText}\\n${sourceMapContent}`;\n}\n\n/**\n * Update the source map contents for improved output.\n */\nfunction updateSourceMap(sourceMapText: string, fileName: string) {\n const sourceMap = JSON.parse(sourceMapText);\n sourceMap.file = fileName;\n sourceMap.sources = [fileName];\n delete sourceMap.sourceRoot;\n return JSON.stringify(sourceMap);\n}\n\n/**\n * Filter diagnostics.\n */\nfunction filterDiagnostics(\n diagnostics: readonly _ts.Diagnostic[],\n filters: DiagnosticFilter[]\n) {\n return diagnostics.filter((d) =>\n filters.every(\n (f) =>\n (!f.appliesToAllFiles &&\n f.filenamesAbsolute.indexOf(d.file?.fileName!) === -1) ||\n f.diagnosticsIgnored.indexOf(d.code) === -1\n )\n );\n}\n\n/**\n * Get token at file position.\n *\n * Reference: https://github.com/microsoft/TypeScript/blob/fcd9334f57d85b73dd66ad2d21c02e84822f4841/src/services/utilities.ts#L705-L731\n */\nfunction getTokenAtPosition(\n ts: TSCommon,\n sourceFile: _ts.SourceFile,\n position: number\n): _ts.Node {\n let current: _ts.Node = sourceFile;\n\n outer: while (true) {\n for (const child of current.getChildren(sourceFile)) {\n const start = child.getFullStart();\n if (start > position) break;\n\n const end = child.getEnd();\n if (position <= end) {\n current = child;\n continue outer;\n }\n }\n\n return current;\n }\n}\n\n/**\n * Create an implementation of node's ESM loader hooks.\n *\n * This may be useful if you\n * want to wrap or compose the loader hooks to add additional functionality or\n * combine with another loader.\n *\n * Node changed the hooks API, so there are two possible APIs. This function\n * detects your node version and returns the appropriate API.\n */\nexport const createEsmHooks: typeof createEsmHooksFn = (\n tsNodeService: Service\n) => (require('./esm') as typeof import('./esm')).createEsmHooks(tsNodeService);\n"]}