Comparing version 0.0.2 to 0.0.3
@@ -21,3 +21,3 @@ /// <reference types="node" /> | ||
*/ | ||
compile(relativeTsPath?: string): Promise<void>; | ||
compile(relativeTsPath?: string): Promise<any>; | ||
buildCachedScripts(relativeTsPath: string, cachedDir: string, jsFileName: string): Promise<Buffer[]>; | ||
@@ -24,0 +24,0 @@ wasModified(tsFilePath: string, jsFilePath: string): Promise<boolean>; |
@@ -93,3 +93,3 @@ "use strict"; | ||
if (!tsWasModified) { | ||
return [2 /*return*/]; | ||
return [2 /*return*/, Promise.resolve().then(function () { return require(cachedFile); })]; | ||
} | ||
@@ -101,3 +101,3 @@ // Cache is incorrect, rebuild. | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
return [2 /*return*/, Promise.resolve().then(function () { return require(cachedFile); })]; | ||
case 3: | ||
@@ -115,3 +115,3 @@ // Create cache directory if it does not exist. | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
return [2 /*return*/, Promise.resolve().then(function () { return require(cachedFile); })]; | ||
} | ||
@@ -118,0 +118,0 @@ }); |
{ | ||
"name": "ts-import", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"license": "GPL-3.0", | ||
@@ -9,3 +9,5 @@ "author": "Artur Kurowski <radarsu@gmail.com>", | ||
"types": "dist/index.d.ts", | ||
"scripts": {}, | ||
"scripts": { | ||
"publish": "rm -rf ./dist && tsc && npm version patch && npm publish" | ||
}, | ||
"dependencies": { | ||
@@ -12,0 +14,0 @@ "ts-options-defaults": "0.0.2" |
@@ -40,3 +40,3 @@ import * as childProcess from 'child_process'; | ||
*/ | ||
async compile(relativeTsPath: string = ``) { | ||
async compile(relativeTsPath: string = ``): Promise<any> { | ||
const { cacheDir } = this.options; | ||
@@ -57,3 +57,3 @@ | ||
if (!tsWasModified) { | ||
return; | ||
return import(cachedFile); | ||
} | ||
@@ -63,3 +63,3 @@ | ||
await this.buildCachedScripts(relativeTsPath, cachedDir, jsFileName); | ||
return; | ||
return import(cachedFile); | ||
} | ||
@@ -76,2 +76,3 @@ | ||
await this.buildCachedScripts(relativeTsPath, cachedDir, jsFileName); | ||
return import(cachedFile); | ||
} | ||
@@ -78,0 +79,0 @@ |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
14721
281
5