Skip to content

Remove unused code #751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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