PATH:
opt
/
bitninja-dispatcher
/
node_modules
/
ts-node
/
dist
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createTsTranspileModule = void 0; /** @internal */ function createTsTranspileModule(ts, transpileOptions) { const { createProgram, createSourceFile, getDefaultCompilerOptions, getImpliedNodeFormatForFile, fixupCompilerOptions, transpileOptionValueCompilerOptions, getNewLineCharacter, fileExtensionIs, normalizePath, Debug, toPath, getSetExternalModuleIndicator, getEntries, addRange, hasProperty, getEmitScriptTarget, getDirectoryPath, } = ts; const compilerOptionsDiagnostics = []; const options = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, compilerOptionsDiagnostics) : {}; // mix in default options const defaultOptions = getDefaultCompilerOptions(); for (const key in defaultOptions) { if (hasProperty(defaultOptions, key) && options[key] === undefined) { options[key] = defaultOptions[key]; } } for (const option of transpileOptionValueCompilerOptions) { options[option.name] = option.transpileOptionValue; } // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths. options.suppressOutputPathCheck = true; // Filename can be non-ts file. options.allowNonTsExtensions = true; const newLine = getNewLineCharacter(options); // Create a compilerHost object to allow the compiler to read and write files const compilerHost = { getSourceFile: (fileName) => fileName === normalizePath(inputFileName) ? sourceFile : undefined, writeFile: (name, text) => { if (fileExtensionIs(name, '.map')) { Debug.assertEqual(sourceMapText, undefined, 'Unexpected multiple source map outputs, file:', name); sourceMapText = text; } else { Debug.assertEqual(outputText, undefined, 'Unexpected multiple outputs, file:', name); outputText = text; } }, getDefaultLibFileName: () => 'lib.d.ts', useCaseSensitiveFileNames: () => true, getCanonicalFileName: (fileName) => fileName, getCurrentDirectory: () => '', getNewLine: () => newLine, fileExists: (fileName) => fileName === inputFileName || fileName === packageJsonFileName, readFile: (fileName) => fileName === packageJsonFileName ? `{"type": "${_packageJsonType}"}` : '', directoryExists: () => true, getDirectories: () => [], }; let inputFileName; let packageJsonFileName; let _packageJsonType; let sourceFile; let outputText; let sourceMapText; return transpileModule; function transpileModule(input, transpileOptions2, packageJsonType = 'commonjs') { // if jsx is specified then treat file as .tsx inputFileName = transpileOptions2.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? 'module.tsx' : 'module.ts'); packageJsonFileName = getDirectoryPath(inputFileName) + '/package.json'; _packageJsonType = packageJsonType; sourceFile = createSourceFile(inputFileName, input, { languageVersion: getEmitScriptTarget(options), impliedNodeFormat: getImpliedNodeFormatForFile(toPath(inputFileName, '', compilerHost.getCanonicalFileName), /*cache*/ undefined, compilerHost, options), setExternalModuleIndicator: getSetExternalModuleIndicator(options), }); if (transpileOptions2.moduleName) { sourceFile.moduleName = transpileOptions2.moduleName; } if (transpileOptions2.renamedDependencies) { sourceFile.renamedDependencies = new Map(getEntries(transpileOptions2.renamedDependencies)); } // Output outputText = undefined; sourceMapText = undefined; const program = createProgram([inputFileName], options, compilerHost); const diagnostics = compilerOptionsDiagnostics.slice(); if (transpileOptions.reportDiagnostics) { addRange( /*to*/ diagnostics, /*from*/ program.getSyntacticDiagnostics(sourceFile)); addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics()); } // Emit program.emit( /*targetSourceFile*/ undefined, /*writeFile*/ undefined, /*cancellationToken*/ undefined, /*emitOnlyDtsFiles*/ undefined, transpileOptions.transformers); if (outputText === undefined) return Debug.fail('Output generation failed'); return { outputText, diagnostics, sourceMapText }; } } exports.createTsTranspileModule = createTsTranspileModule; //# sourceMappingURL=ts-transpile-module.js.map
[-] node-module-type-classifier.js.map
[edit]
[-] util.js.map
[edit]
[-] bin-script-deprecated.js
[edit]
[-] cjs-resolve-hooks.js.map
[edit]
[-] ts-internals.js
[edit]
[-] node-module-type-classifier.d.ts
[edit]
[-] repl.js.map
[edit]
[-] tsconfig-schema.js.map
[edit]
[-] index.js.map
[edit]
[-] ts-compiler-types.js
[edit]
[-] tsconfig-schema.js
[edit]
[-] file-extensions.js
[edit]
[+]
child
[-] bin-cwd.js.map
[edit]
[+]
..
[-] ts-transpile-module.js
[edit]
[-] resolver-functions.js
[edit]
[-] esm.js
[edit]
[-] util.d.ts
[edit]
[-] esm.js.map
[edit]
[-] bin-cwd.js
[edit]
[-] index.d.ts
[edit]
[-] tsconfig-schema.d.ts
[edit]
[-] module-type-classifier.js.map
[edit]
[-] file-extensions.js.map
[edit]
[-] ts-compiler-types.d.ts
[edit]
[-] bin-esm.js
[edit]
[-] repl.d.ts
[edit]
[-] cjs-resolve-hooks.d.ts
[edit]
[-] bin-transpile.js.map
[edit]
[-] esm.d.ts
[edit]
[-] repl.js
[edit]
[-] ts-transpile-module.d.ts
[edit]
[-] bin.d.ts
[edit]
[+]
transpilers
[-] ts-transpile-module.js.map
[edit]
[-] module-type-classifier.d.ts
[edit]
[-] configuration.d.ts
[edit]
[-] configuration.js
[edit]
[-] bin-transpile.js
[edit]
[-] bin-script.js.map
[edit]
[-] tsconfigs.js
[edit]
[-] index.js
[edit]
[-] bin.js.map
[edit]
[-] util.js
[edit]
[-] tsconfigs.d.ts
[edit]
[-] ts-internals.d.ts
[edit]
[-] bin-cwd.d.ts
[edit]
[-] file-extensions.d.ts
[edit]
[-] node-module-type-classifier.js
[edit]
[-] bin-script-deprecated.d.ts
[edit]
[-] resolver-functions.js.map
[edit]
[-] cjs-resolve-hooks.js
[edit]
[-] configuration.js.map
[edit]
[-] bin-transpile.d.ts
[edit]
[-] bin-esm.js.map
[edit]
[-] bin-script.js
[edit]
[-] bin-script-deprecated.js.map
[edit]
[-] ts-compiler-types.js.map
[edit]
[-] module-type-classifier.js
[edit]
[-] bin-esm.d.ts
[edit]
[-] resolver-functions.d.ts
[edit]
[-] ts-internals.js.map
[edit]
[-] tsconfigs.js.map
[edit]
[-] bin-script.d.ts
[edit]
[-] bin.js
[edit]