@abacus-network/utils
Advanced tools
Comparing version 0.4.1 to 0.4.2-processtest
@@ -5,3 +5,4 @@ "use strict"; | ||
exports.error = exports.warn = exports.log = exports.debug = exports.trace = void 0; | ||
const ENV_LOG_LEVEL = ((_a = process.env['LOG_LEVEL']) !== null && _a !== void 0 ? _a : 'debug').toLowerCase(); | ||
const utils_1 = require("./utils"); | ||
const ENV_LOG_LEVEL = ((_a = (0, utils_1.safelyAccessEnvVar)('LOG_LEVEL')) !== null && _a !== void 0 ? _a : 'debug').toLowerCase(); | ||
const LOG_TRACE = ENV_LOG_LEVEL == 'trace'; | ||
@@ -8,0 +9,0 @@ const LOG_DEBUG = LOG_TRACE || ENV_LOG_LEVEL == 'debug'; |
@@ -38,2 +38,3 @@ /// <reference types="node" /> | ||
export declare function timeout<T>(promise: Promise<T>, timeoutMs?: number, message?: string): Promise<T>; | ||
export declare function safelyAccessEnvVar(name: string): string | undefined; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -12,3 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.timeout = exports.isCheckpoint = exports.streamToString = exports.stdDev = exports.mean = exports.sum = exports.median = exports.retryAsync = exports.sleep = exports.domainHash = exports.destinationAndNonce = exports.messageHash = exports.parseMessage = exports.formatMessage = exports.formatCallData = exports.bytes32ToAddress = exports.addressToBytes32 = exports.strip0x = exports.ensure0x = exports.deepEquals = exports.assert = void 0; | ||
exports.safelyAccessEnvVar = exports.timeout = exports.isCheckpoint = exports.streamToString = exports.stdDev = exports.mean = exports.sum = exports.median = exports.retryAsync = exports.sleep = exports.domainHash = exports.destinationAndNonce = exports.messageHash = exports.parseMessage = exports.formatMessage = exports.formatCallData = exports.bytes32ToAddress = exports.addressToBytes32 = exports.strip0x = exports.ensure0x = exports.deepEquals = exports.assert = void 0; | ||
const ethers_1 = require("ethers"); | ||
@@ -164,2 +164,13 @@ function assert(predicate, errorMessage) { | ||
exports.timeout = timeout; | ||
// Should be used instead of referencing process directly in case we don't | ||
// run in node.js | ||
function safelyAccessEnvVar(name) { | ||
try { | ||
return process.env[name]; | ||
} | ||
catch (error) { | ||
return undefined; | ||
} | ||
} | ||
exports.safelyAccessEnvVar = safelyAccessEnvVar; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@abacus-network/utils", | ||
"description": "General utilities for the Abacus network", | ||
"version": "0.4.1", | ||
"version": "0.4.2-processtest", | ||
"dependencies": { | ||
@@ -32,3 +32,4 @@ "ethers": "^5.6.8" | ||
"/dist" | ||
] | ||
} | ||
], | ||
"stableVersion": "0.4.1" | ||
} |
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
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
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
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
37003
25
481
2