Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-import

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-import - npm Package Compare versions

Comparing version 2.0.29 to 2.0.30

17

dist/index.js

@@ -47,2 +47,8 @@ "use strict";

function Compiler(options) {
// Support setting rootDir and outDir on windows from different drives based process.cwd().
if (process.platform === "win32") {
var driveLetter = process.cwd().charAt(0);
Compiler.defaults.compilerOptions.outDir = path.resolve(Compiler.defaults.compilerOptions.outDir, driveLetter);
Compiler.defaults.compilerOptions.rootDir = driveLetter + ":/";
}
this.options = options_defaults_1.defaults(Compiler.defaults, options);

@@ -63,3 +69,3 @@ }

}
tsDir = path.dirname(tsPath).replace(/^(?<driveLetter>[a-zA-Z]):/u, "$<driveLetter>");
tsDir = path.dirname(tsPath);
ctx = {

@@ -77,3 +83,3 @@ cwd: cwd,

return __awaiter(this, void 0, void 0, function () {
var logger, tsPath, tsDir, cwd, tsFileName, jsFileName, cacheDir, jsPath, tsWasModified, buildError;
var logger, tsPath, tsDir, cwd, tsFileName, jsFileName, tsDirWithoutDriveLetter, cacheDir, jsPath, tsWasModified, buildError;
return __generator(this, function (_h) {

@@ -86,3 +92,4 @@ switch (_h.label) {

jsFileName = tsFileName.replace(/\.[^/.]+$/u, ".js");
cacheDir = path.resolve(this.options.compilerOptions.outDir, "." + tsDir);
tsDirWithoutDriveLetter = tsDir.replace(/^(?<driveLetter>[a-zA-Z]):/u, "");
cacheDir = path.resolve(this.options.compilerOptions.outDir, "." + tsDirWithoutDriveLetter);
jsPath = path.resolve(cacheDir, jsFileName);

@@ -141,3 +148,3 @@ (_a = logger === null || logger === void 0 ? void 0 : logger.verbose) === null || _a === void 0 ? void 0 : _a.call(logger, "Looking for cached file at " + jsPath);

logger = this.options.logger;
tmpTsConfigPath = path.join(this.options.compilerOptions.outDir, path.dirname(absoluteTsPath), "tsconfig-" + path.basename(absoluteTsPath) + ".tmp.json");
tmpTsConfigPath = path.join(this.options.compilerOptions.outDir, path.dirname(absoluteTsPath).replace(/^(?<driveLetter>[a-zA-Z]):/u, ""), "tsconfig-" + path.basename(absoluteTsPath) + ".tmp.json");
return [4 /*yield*/, fs.promises.writeFile(tmpTsConfigPath, JSON.stringify({

@@ -152,3 +159,3 @@ compilerOptions: this.options.compilerOptions,

var _a, _b;
var compileCommand = "npx -p typescript tsc --project '" + tmpTsConfigPath + "'";
var compileCommand = "npx -p typescript tsc --project \"" + tmpTsConfigPath + "\"";
(_a = logger === null || logger === void 0 ? void 0 : logger.info) === null || _a === void 0 ? void 0 : _a.call(logger, "Compiling " + absoluteTsPath);

@@ -155,0 +162,0 @@ (_b = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _b === void 0 ? void 0 : _b.call(logger, "Command: " + compileCommand);

{
"name": "ts-import",
"version": "2.0.29",
"version": "2.0.30",
"description": "Import (compile and cache on the fly) TypeScript files dynamically with ease.",

@@ -21,6 +21,6 @@ "license": "MIT",

"dependencies": {
"options-defaults": "^2.0.29"
"options-defaults": "^2.0.30"
},
"devDependencies": {
"@radrat-node/logger": "^2.0.29",
"@radrat-node/logger": "^2.0.30",
"@types/jest": "^26.0.20",

@@ -36,3 +36,3 @@ "@types/node": "^14.14.35",

},
"gitHead": "f2c0a184d77ce278e7ba3753c34321b95e69974f"
"gitHead": "fa6a80ce57ce1ea71bfb9a352ed9c648fc8dce5c"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc