@soinlabs/hawk
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "@soinlabs/hawk", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -23,3 +23,3 @@ const FileWriter = require("./FileWriter.js"); | ||
this.path = null; | ||
this.setReferenceCode(options.referenceCode) | ||
this.setReferenceCode(options.referenceCode); | ||
this.setPath(options.path); | ||
@@ -39,4 +39,3 @@ this.slackToken = | ||
this.datepattern | ||
); | ||
); | ||
} | ||
@@ -48,4 +47,4 @@ /** | ||
setPath(path) { | ||
const env = process.env.ENV_VARS || process.env.NODE_ENV; | ||
if (env === "test" || env === "testing") { | ||
if (this.isTestEnvironment()) { | ||
console.warn("You are using Hawk in test environment mode"); | ||
this.path = os.tmpdir(); | ||
@@ -58,2 +57,12 @@ } else if (path !== null && path !== undefined) { | ||
/** | ||
* Cheks if app is running on test mode | ||
* @param {String} env environment | ||
*/ | ||
isTestEnvironment() { | ||
const env = | ||
process.env.HAWK_ENV_MODE || process.env.ENV_VARS || process.env.NODE_ENV; | ||
return env === "test" || env === "testing" || env.match(/^(testing)(.)*/i); | ||
} | ||
/** | ||
* Set slackToken value | ||
@@ -124,5 +133,3 @@ * @param {String} slackToken | ||
if (toElastic === false) log.type = "LOG"; | ||
this.fileWriter.write( | ||
log, | ||
); | ||
this.fileWriter.write(log); | ||
} | ||
@@ -129,0 +136,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
33714
822
8