config-file-ts
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -23,2 +23,2 @@ /** Return true if any files need compiling */ | ||
*/ | ||
export declare function compileConfigIfNecessary(tsFile: string, outDir: string): string | undefined; | ||
export declare function compileConfigIfNecessary(tsFile: string, outDir: string, strict?: boolean): string | undefined; |
@@ -161,3 +161,3 @@ 'use strict'; | ||
*/ | ||
function compileConfigIfNecessary(tsFile, outDir) { | ||
function compileConfigIfNecessary(tsFile, outDir, strict = false) { | ||
if (!fs__default['default'].existsSync(tsFile)) { | ||
@@ -167,3 +167,3 @@ console.error("config file:", tsFile, " not found"); | ||
} | ||
const success = compileIfNecessary([tsFile], outDir); | ||
const success = compileIfNecessary([tsFile], outDir, strict); | ||
if (!success) { | ||
@@ -170,0 +170,0 @@ return undefined; |
{ | ||
"name": "config-file-ts", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -141,3 +141,4 @@ import glob from "glob"; | ||
tsFile: string, | ||
outDir: string | ||
outDir: string, | ||
strict = true | ||
): string | undefined { | ||
@@ -149,3 +150,3 @@ if (!fs.existsSync(tsFile)) { | ||
const success = compileIfNecessary([tsFile], outDir); | ||
const success = compileIfNecessary([tsFile], outDir, strict); | ||
if (!success) { | ||
@@ -152,0 +153,0 @@ return undefined; |
@@ -14,6 +14,7 @@ import { compileConfigIfNecessary } from "./compileUtil"; | ||
tsFile: string, | ||
outDir?: string | ||
outDir?: string, | ||
strict = true | ||
): T | undefined { | ||
const realOutDir = outDir || defaultOutDir(tsFile, "config-file-ts"); | ||
const jsConfig = compileConfigIfNecessary(tsFile, realOutDir); | ||
const jsConfig = compileConfigIfNecessary(tsFile, realOutDir, strict); | ||
if (!jsConfig) { | ||
@@ -20,0 +21,0 @@ return undefined; |
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
37693
499