Comparing version 6.0.1 to 6.0.2
@@ -209,12 +209,13 @@ "use strict"; | ||
getScriptSnapshot: function (fileName) { | ||
if (!memoryCache.contents[fileName]) { | ||
var contents = readFile(fileName); | ||
if (!contents) | ||
return; | ||
memoryCache.contents[fileName] = contents; | ||
// Read contents into TypeScript memory cache. | ||
if (!Object.prototype.hasOwnProperty.call(memoryCache.contents, fileName)) { | ||
memoryCache.contents[fileName] = readFile(fileName); | ||
} | ||
return ts.ScriptSnapshot.fromString(memoryCache.contents[fileName]); | ||
var contents = memoryCache.contents[fileName]; | ||
if (contents === undefined) | ||
return; | ||
return ts.ScriptSnapshot.fromString(contents); | ||
}, | ||
fileExists: debugFn('fileExists', fileExists), | ||
readFile: debugFn('getFile', readFile), | ||
readFile: debugFn('readFile', readFile), | ||
readDirectory: debugFn('readDirectory', ts.sys.readDirectory), | ||
@@ -221,0 +222,0 @@ getDirectories: debugFn('getDirectories', ts.sys.getDirectories), |
@@ -82,2 +82,9 @@ "use strict"; | ||
}); | ||
it('should import empty files', function (done) { | ||
child_process_1.exec(BIN_EXEC + " -e \"import './tests/empty'\"", function (err, stdout) { | ||
chai_1.expect(err).to.equal(null); | ||
chai_1.expect(stdout).to.equal(''); | ||
return done(); | ||
}); | ||
}); | ||
it('should throw errors', function (done) { | ||
@@ -84,0 +91,0 @@ child_process_1.exec(BIN_EXEC + " -e \"import * as m from './tests/module';console.log(m.example(123))\"", function (err) { |
{ | ||
"name": "ts-node", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "TypeScript execution environment and REPL for node", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
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
127526
1133