t0n
Version:
Collection of elegant typescript resources for web artisans
46 lines (36 loc) • 962 B
text/typescript
import { DataBag } from './databag'
export class Envir {
static
static {
this.
}
static has(key: string): boolean {
try {
return this.
} catch {
return false
}
}
static get<T = any>(key: string, defaultValue?: T): T | undefined {
if (this.
return this.
try {
const envValue = process?.env[key]
return envValue !== undefined ? envValue as T : defaultValue
} catch {
return defaultValue
}
}
static set<T = any>(key: string, value: T): void {
this.
}
static remove(key: string): void {
this.
}
static add<T = any>(data: Record<string, T> = {}): void {
this.
}
static replace<T = any>(data: Record<string, T> = {}): void {
this.
}
}