Skip to content

Commit

Permalink
Downgrade yn due to node engine (#942)
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode authored and blakeembrey committed Jan 13, 2020
1 parent b90754e commit 8db216c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@
"diff": "^4.0.1",
"make-error": "^1.1.1",
"source-map-support": "^0.5.6",
"yn": "^4.0.0"
"yn": "3.1.1"
}
}
10 changes: 9 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { relative, basename, extname, resolve, dirname, join } from 'path'
import sourceMapSupport = require('source-map-support')
import * as yn from 'yn'
import * as ynModule from 'yn'
import { BaseError } from 'make-error'
import * as util from 'util'
import * as _ts from 'typescript'
Expand All @@ -26,6 +26,14 @@ declare global {
*/
export const INSPECT_CUSTOM = util.inspect.custom || 'inspect'

/**
* Wrapper around yn module that returns `undefined` instead of `null`.
* This is implemented by yn v4, but we're staying on v3 to avoid v4's node 10 requirement.
*/
function yn (value: string | undefined) {
return ynModule(value) ?? undefined
}

/**
* Debugging `ts-node`.
*/
Expand Down

0 comments on commit 8db216c

Please sign in to comment.