@abacus-network/utils
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -5,9 +5,2 @@ "use strict"; | ||
exports.error = exports.warn = exports.log = exports.debug = exports.trace = void 0; | ||
const console_1 = require("console"); | ||
const console = new console_1.Console({ | ||
stdout: process.stdout, | ||
stderr: process.stderr, | ||
groupIndentation: 4, | ||
}); | ||
const consoleLog = console.log.bind(console); | ||
const ENV_LOG_LEVEL = ((_a = process.env['LOG_LEVEL']) !== null && _a !== void 0 ? _a : 'debug').toLowerCase(); | ||
@@ -21,3 +14,3 @@ const LOG_TRACE = ENV_LOG_LEVEL == 'trace'; | ||
if (LOG_TRACE) | ||
logWithFunction(consoleLog, 'trace', message, data); | ||
logWithFunction(console.trace, 'trace', message, data); | ||
} | ||
@@ -27,3 +20,3 @@ exports.trace = trace; | ||
if (LOG_DEBUG) | ||
logWithFunction(consoleLog, 'debug', message, data); | ||
logWithFunction(console.debug, 'debug', message, data); | ||
} | ||
@@ -33,3 +26,3 @@ exports.debug = debug; | ||
if (LOG_INFO) | ||
logWithFunction(consoleLog, 'info', message, data); | ||
logWithFunction(console.log, 'info', message, data); | ||
} | ||
@@ -39,3 +32,3 @@ exports.log = log; | ||
if (LOG_WARN) | ||
logWithFunction(consoleLog, 'warn', message, data); | ||
logWithFunction(console.warn, 'warn', message, data); | ||
} | ||
@@ -45,3 +38,3 @@ exports.warn = warn; | ||
if (LOG_ERROR) | ||
logWithFunction(consoleLog, 'error', message, data); | ||
logWithFunction(console.error, 'error', message, data); | ||
} | ||
@@ -48,0 +41,0 @@ exports.error = error; |
@@ -157,3 +157,3 @@ "use strict"; | ||
setTimeout(() => { | ||
throw new Error(message); | ||
reject(new Error(message)); | ||
}, timeoutMs); | ||
@@ -160,0 +160,0 @@ promise.then(resolve).catch(reject); |
{ | ||
"name": "@abacus-network/utils", | ||
"description": "General utilities for the Abacus network", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"dependencies": { | ||
@@ -6,0 +6,0 @@ "ethers": "^5.6.8" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
1
34071
434