@bunt/util
Advanced tools
Comparing version 0.21.4 to 0.21.5
@@ -1,3 +0,2 @@ | ||
import { Promisify } from ".."; | ||
import { Fn } from "../interfaces"; | ||
import { Promisify, Fn } from "../interfaces"; | ||
export declare class AsyncCallback<T> implements AsyncIterable<T> { | ||
@@ -4,0 +3,0 @@ #private; |
@@ -18,3 +18,3 @@ "use strict"; | ||
const util_1 = require("util"); | ||
const __1 = require(".."); | ||
const assert_1 = require("../assert"); | ||
const function_1 = require("../function"); | ||
@@ -105,3 +105,3 @@ const is_1 = require("../is"); | ||
const matched = [...message.match(placeholderRegex) ?? []]; | ||
(0, __1.assert)(matched.length <= args.length, "Logger.format(message, ...args): args count less than placeholders"); | ||
(0, assert_1.assert)(matched.length <= args.length, "Logger.format(message, ...args): args count less than placeholders"); | ||
return { | ||
@@ -108,0 +108,0 @@ message: (0, util_1.format)(message, ...args.slice(0, matched.length)), |
/// <reference types="node" /> | ||
import { Dict } from "./interfaces"; | ||
export declare type EnvKey = string | number | symbol; | ||
export declare type EnvDefaultValue = string | undefined; | ||
export declare class Env<T extends Record<string, EnvDefaultValue>> { | ||
export declare class Env<T extends Dict<string>> { | ||
#private; | ||
constructor(env: Record<string, EnvDefaultValue>); | ||
static factory<T extends Record<string, EnvDefaultValue>>(env?: NodeJS.ProcessEnv): Env<T>; | ||
constructor(env: Dict<string>); | ||
static factory<T extends Dict<string>>(env?: NodeJS.ProcessEnv): Env<T>; | ||
get<K extends keyof T>(key: K): string | undefined; | ||
@@ -8,0 +10,0 @@ get<K extends keyof T>(key: K, defaultValue: string): string; |
@@ -16,3 +16,3 @@ "use strict"; | ||
exports.Env = void 0; | ||
const __1 = require(".."); | ||
const assert_1 = require("../assert"); | ||
class Env { | ||
@@ -31,3 +31,3 @@ constructor(env) { | ||
const value = this.get(key); | ||
(0, __1.assert)(value, `The key '${key}'' must be provided in runtime environment`); | ||
(0, assert_1.assert)(value, `The key '${key}'' must be provided in runtime environment`); | ||
return fn | ||
@@ -34,0 +34,0 @@ ? fn(value) |
export * from "./Argv"; | ||
export * from "./Program"; | ||
export * from "./Env"; | ||
export * from "./interfaces"; |
@@ -16,2 +16,3 @@ "use strict"; | ||
__exportStar(require("./Env"), exports); | ||
__exportStar(require("./interfaces"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const __1 = require(".."); | ||
const Logger_1 = require("../Logger"); | ||
if (process.env.NODE_ENV === "test" && process.env.LOGGER_ENABLE === "Y") { | ||
__1.Logger.setSeverity(__1.SeverityLevel.DEBUG); | ||
__1.Logger.set([new __1.StdOutTransport(__1.debugLogFormat)]); | ||
Logger_1.Logger.setSeverity(Logger_1.SeverityLevel.DEBUG); | ||
Logger_1.Logger.set([new Logger_1.StdOutTransport(Logger_1.debugLogFormat)]); | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@bunt/util", | ||
"version": "0.21.4", | ||
"version": "0.21.5", | ||
"keywords": [ | ||
@@ -29,3 +29,3 @@ "typescript" | ||
"license": "MIT", | ||
"gitHead": "3439249630655847543ecef7a0641765a46612ce" | ||
"gitHead": "c7266115704a1ffeba8058a047dbdaa65f365131" | ||
} |
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
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
140512
176
2141