Comparing version 8.1.1 to 8.2.0
@@ -49,3 +49,2 @@ "use strict"; | ||
if (rootFileNames === void 0) { rootFileNames = []; } | ||
this.rootFileNames = rootFileNames; | ||
this.fileContents = new Map(); | ||
@@ -130,2 +129,5 @@ this.fileVersions = new Map(); | ||
exports.TSError = TSError; | ||
/** | ||
* Cached fs operation wrapper. | ||
*/ | ||
function cachedLookup(fn) { | ||
@@ -137,3 +139,3 @@ var cache = new Map(); | ||
} | ||
return cache.get(arg) || false; | ||
return cache.get(arg); | ||
}; | ||
@@ -237,5 +239,6 @@ } | ||
var memoryCache_1 = new MemoryCache(config.fileNames); | ||
var cachedReadFile_1 = cachedLookup(debugFn('readFile', readFile)); | ||
// Create the compiler host for type checking. | ||
var serviceHost = { | ||
getScriptFileNames: function () { return memoryCache_1.rootFileNames; }, | ||
getScriptFileNames: function () { return Array.from(memoryCache_1.fileVersions.keys()); }, | ||
getScriptVersion: function (fileName) { | ||
@@ -249,3 +252,3 @@ var version = memoryCache_1.fileVersions.get(fileName); | ||
if (contents === undefined) { | ||
contents = readFile(fileName); | ||
contents = cachedReadFile_1(fileName); | ||
if (contents === undefined) | ||
@@ -258,6 +261,6 @@ return; | ||
}, | ||
readFile: cachedReadFile_1, | ||
readDirectory: cachedLookup(debugFn('readDirectory', ts.sys.readDirectory)), | ||
getDirectories: cachedLookup(debugFn('getDirectories', ts.sys.getDirectories)), | ||
fileExists: cachedLookup(debugFn('fileExists', fileExists)), | ||
readFile: debugFn('readFile', readFile), | ||
readDirectory: debugFn('readDirectory', ts.sys.readDirectory), | ||
getDirectories: debugFn('getDirectories', ts.sys.getDirectories), | ||
directoryExists: cachedLookup(debugFn('directoryExists', ts.sys.directoryExists)), | ||
@@ -276,5 +279,2 @@ getNewLine: function () { return ts.sys.newLine; }, | ||
var fileVersion = memoryCache_1.fileVersions.get(fileName) || 0; | ||
// Add to `rootFiles` when discovered for the first time. | ||
if (fileVersion === 0) | ||
memoryCache_1.rootFileNames.push(fileName); | ||
// Avoid incrementing cache when nothing has changed. | ||
@@ -281,0 +281,0 @@ if (memoryCache_1.fileContents.get(fileName) === contents) |
{ | ||
"name": "ts-node", | ||
"version": "8.1.1", | ||
"version": "8.2.0", | ||
"description": "TypeScript execution environment and REPL for node.js, with source map support", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127850