|
1 | 1 | import { relative, basename, extname, resolve, dirname, join } from 'path' |
2 | | -import { readFileSync, writeFileSync } from 'fs' |
3 | | -import { EOL, tmpdir, homedir } from 'os' |
| 2 | +import { EOL } from 'os' |
4 | 3 | import sourceMapSupport = require('source-map-support') |
5 | | -import mkdirp = require('mkdirp') |
6 | | -import crypto = require('crypto') |
7 | 4 | import yn = require('yn') |
8 | 5 | import arrify = require('arrify') |
9 | 6 | import { BaseError } from 'make-error' |
@@ -150,15 +147,6 @@ export interface Register { |
150 | 147 | getTypeInfo (code: string, fileName: string, position: number): TypeInfo |
151 | 148 | } |
152 | 149 |
|
153 | | -/** |
154 | | - * Return a default temp directory based on home directory of user. |
155 | | - */ |
156 | | -function getTmpDir (): string { |
157 | | - const hash = crypto.createHash('sha256').update(homedir(), 'utf8').digest('hex') |
158 | | - |
159 | | - return join(tmpdir(), `ts-node-${hash}`) |
160 | | -} |
161 | | - |
162 | 150 | /** |
163 | 151 | * Register TypeScript compiler. |
164 | 152 | */ |
@@ -193,7 +181,6 @@ export function register (opts: Options = {}): Register { |
193 | 181 | // Require the TypeScript compiler and configuration. |
194 | 182 | const cwd = process.cwd() |
195 | 183 | const { compilerOptions, project, skipProject } = options |
196 | | - const compiler = options.compiler || 'typescript' |
197 | 184 | const typeCheck = options.typeCheck === true || options.transpileOnly !== true |
198 | 185 | const transformers = options.transformers || undefined |
199 | 186 | const readFile = options.readFile || ts.sys.readFile |
@@ -504,13 +491,6 @@ function updateSourceMap (sourceMapText: string, fileName: string) { |
504 | 491 | return JSON.stringify(sourceMap) |
505 | 492 | } |
506 | 493 |
|
507 | | -/** |
508 | | - * Create a hash of the current configuration. |
509 | | - */ |
510 | | -function getCompilerDigest (obj: object) { |
511 | | - return crypto.createHash('sha256').update(JSON.stringify(obj), 'utf8').digest('hex') |
512 | | -} |
513 | | - |
514 | 494 | /** |
515 | 495 | * Filter diagnostics. |
516 | 496 | */ |
|
0 commit comments