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 0.0.9-0 to 0.0.9-1

2

dist/index.d.ts

@@ -21,3 +21,3 @@ /// <reference types="node" />

*/
compile(absoluteTsPath?: string): Promise<any>;
compile(tsPath?: string): Promise<any>;
buildCachedScripts(absoluteTsPath: string): Promise<Buffer[]>;

@@ -24,0 +24,0 @@ wasModified(tsFilePath: string, jsFilePath: string): Promise<boolean>;

@@ -74,6 +74,6 @@ "use strict";

*/
Compiler.prototype.compile = function (absoluteTsPath) {
if (absoluteTsPath === void 0) { absoluteTsPath = ""; }
Compiler.prototype.compile = function (tsPath) {
if (tsPath === void 0) { tsPath = ""; }
return __awaiter(this, void 0, void 0, function () {
var cacheDir, tsPathArr, tsFileName, jsFileName, tsDir, cachedDir, cachedFile, tsWasModified;
var cacheDir, absoluteTsPath, tsFileName, jsFileName, absoluteTsDir, cachedDir, cachedFile, tsWasModified;
return __generator(this, function (_a) {

@@ -83,7 +83,7 @@ switch (_a.label) {

cacheDir = this.options.cacheDir;
tsPathArr = absoluteTsPath.split('/');
tsFileName = tsPathArr.pop();
absoluteTsPath = path.resolve(process.cwd(), tsPath);
tsFileName = path.basename(absoluteTsPath);
jsFileName = tsFileName.replace(/\.[^/.]+$/, ".js");
tsDir = tsPathArr.join('/');
cachedDir = path.resolve(cacheDir, tsDir);
absoluteTsDir = path.dirname(absoluteTsPath);
cachedDir = path.resolve(cacheDir, absoluteTsDir);
cachedFile = path.resolve(cachedDir, jsFileName);

@@ -90,0 +90,0 @@ if (!fs.existsSync(cachedFile)) return [3 /*break*/, 3];

{
"name": "ts-import",
"version": "0.0.9-0",
"version": "0.0.9-1",
"license": "GPL-3.0",

@@ -5,0 +5,0 @@ "author": "Artur Kurowski <radarsu@gmail.com>",

@@ -40,11 +40,12 @@ import * as childProcess from 'child_process';

*/
async compile(absoluteTsPath: string = ``): Promise<any> {
async compile(tsPath: string = ``): Promise<any> {
const { cacheDir } = this.options;
const tsPathArr = absoluteTsPath.split('/');
const tsFileName = tsPathArr.pop();
const absoluteTsPath = path.resolve(process.cwd(), tsPath);
const tsFileName = path.basename(absoluteTsPath);
const jsFileName = tsFileName.replace(/\.[^/.]+$/, `.js`);
const tsDir = tsPathArr.join('/');
const absoluteTsDir = path.dirname(absoluteTsPath);
const cachedDir = path.resolve(cacheDir, tsDir);
const cachedDir = path.resolve(cacheDir, absoluteTsDir);
const cachedFile = path.resolve(cachedDir, jsFileName);

@@ -51,0 +52,0 @@

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