Skip to content

Commit

Permalink
Remove unused code (#751)
Browse files Browse the repository at this point in the history
  • Loading branch information
3mard authored and blakeembrey committed Jan 21, 2019
1 parent d58488b commit abcb13b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 33 deletions.
13 changes: 3 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@types/chai": "^4.0.4",
"@types/diff": "^3.2.1",
"@types/minimist": "^1.2.0",
"@types/mkdirp": "^0.5.0",
"@types/mocha": "^5.0.0",
"@types/node": "^10.0.3",
"@types/proxyquire": "^1.3.28",
Expand All @@ -79,7 +78,6 @@
"diff": "^3.1.0",
"make-error": "^1.1.1",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"source-map-support": "^0.5.6",
"yn": "^2.0.0"
}
Expand Down
22 changes: 1 addition & 21 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { relative, basename, extname, resolve, dirname, join } from 'path'
import { readFileSync, writeFileSync } from 'fs'
import { EOL, tmpdir, homedir } from 'os'
import { EOL } from 'os'
import sourceMapSupport = require('source-map-support')
import mkdirp = require('mkdirp')
import crypto = require('crypto')
import yn = require('yn')
import arrify = require('arrify')
import { BaseError } from 'make-error'
Expand Down Expand Up @@ -150,15 +147,6 @@ export interface Register {
getTypeInfo (code: string, fileName: string, position: number): TypeInfo
}

/**
* Return a default temp directory based on home directory of user.
*/
function getTmpDir (): string {
const hash = crypto.createHash('sha256').update(homedir(), 'utf8').digest('hex')

return join(tmpdir(), `ts-node-${hash}`)
}

/**
* Register TypeScript compiler.
*/
Expand Down Expand Up @@ -193,7 +181,6 @@ export function register (opts: Options = {}): Register {
// Require the TypeScript compiler and configuration.
const cwd = process.cwd()
const { compilerOptions, project, skipProject } = options
const compiler = options.compiler || 'typescript'
const typeCheck = options.typeCheck === true || options.transpileOnly !== true
const transformers = options.transformers || undefined
const readFile = options.readFile || ts.sys.readFile
Expand Down Expand Up @@ -504,13 +491,6 @@ function updateSourceMap (sourceMapText: string, fileName: string) {
return JSON.stringify(sourceMap)
}

/**
* Create a hash of the current configuration.
*/
function getCompilerDigest (obj: object) {
return crypto.createHash('sha256').update(JSON.stringify(obj), 'utf8').digest('hex')
}

/**
* Filter diagnostics.
*/
Expand Down

0 comments on commit abcb13b

Please sign in to comment.