ts-runtime
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -16,2 +16,3 @@ #!/usr/bin/env node | ||
let compilerOptions = '{}'; | ||
let tsConfigPath; | ||
function defaultAction() { | ||
@@ -23,3 +24,10 @@ const files = commander.args | ||
} | ||
const opts = ts.convertCompilerOptionsFromJson(JSON.parse(compilerOptions), '.'); | ||
compilerOptions = JSON.parse(compilerOptions); | ||
if (tsConfigPath && ts.sys.fileExists(tsConfigPath)) { | ||
const tsConfig = require(path.resolve(tsConfigPath)); | ||
if (tsConfig.hasOwnProperty('compilerOptions')) { | ||
compilerOptions = tsConfig.compilerOptions; | ||
} | ||
} | ||
const opts = ts.convertCompilerOptionsFromJson(compilerOptions, '.'); | ||
options.log = false; | ||
@@ -34,2 +42,5 @@ options.compilerOptions = opts.options; | ||
} | ||
function useTsConfig(path) { | ||
tsConfigPath = path; | ||
} | ||
function setNoAnnotate() { | ||
@@ -75,3 +86,3 @@ options.noAnnotate = true; | ||
} | ||
function setTempFolder(name) { | ||
function setTempFolderName(name) { | ||
options.tempFolderName = name; | ||
@@ -91,2 +102,3 @@ } | ||
.option('-c, --compilerOptions <compilerOptions>', 'set TypeScript compiler options. defaults to "{}"', setCompilerOptions) | ||
.option('-C, --tsConfig <path>', 'use the compiler options of the given tsconfig.json', useTsConfig) | ||
.option('-d, --declarationFileName <fileName>', 'set file name for global declarations. defaults to "tsr-declarations"', setDeclarationFileName) | ||
@@ -102,3 +114,3 @@ .option('-e, --excludeDeclarationFile', 'do not automatically import ambient declarations in the entry file. default to false', setExcludeDeclarationFile) | ||
.option('-s, --stackTraceOutput <limit>', 'output a specified number of lines of the stack trace. defaults to 3', setStackTraceOutput) | ||
.option('-t, --tempFolder <name>', 'set folder name for temporary files. defaults to ".tsr"', setTempFolder) | ||
.option('-t, --tempFolderName <name>', 'set folder name for temporary files. defaults to ".tsr"', setTempFolderName) | ||
.on('--help', () => { | ||
@@ -105,0 +117,0 @@ console.log(' Examples:'); |
@@ -901,3 +901,3 @@ "use strict"; | ||
nostrict(reflection) { | ||
return this.strictNullChecks ? reflection : this.libCall('nostrict', reflection); | ||
return this.strictNullChecks ? reflection : this.libCall('nullable', reflection); | ||
} | ||
@@ -904,0 +904,0 @@ intersect(args) { |
{ | ||
"name": "ts-runtime", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Runtime type checks for TypeScript", | ||
@@ -27,3 +27,3 @@ "main": "index.js", | ||
"find-up": "^2.1.0", | ||
"flow-runtime": "^0.12.0", | ||
"flow-runtime": "^0.13.0", | ||
"ora": "^1.2.0", | ||
@@ -30,0 +30,0 @@ "pretty-time": "^0.2.0", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
177272
3805
3
+ Addedflow-runtime@0.13.0(transitive)
- Removedflow-runtime@0.12.0(transitive)
Updatedflow-runtime@^0.13.0