MCPcopy
hub / github.com/jef/streetmerchant / envOrBoolean

Function envOrBoolean

src/config.ts:56–61  ·  view source on GitHub ↗

* Returns environment variable, given boolean, or default boolean. * * @param environment Interested environment variable. * @param boolean Default boolean. If not set, is `true`.

(
  environment: string | undefined,
  boolean?: boolean
)

Source from the content-addressed store, hash-verified

54 * @param boolean Default boolean. If not set, is `true`.
55 */
56function envOrBoolean(
57 environment: string | undefined,
58 boolean?: boolean
59): boolean {
60 return environment ? environment === 'true' : boolean ?? true;
61}
62
63/**
64 * Returns environment variable, given string, or default string.

Callers 1

config.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected