17 lines
593 B
JavaScript
17 lines
593 B
JavaScript
/**
|
|
* Default-on meshdrop channel toggle.
|
|
* Disable only with explicit falsey env:
|
|
* - BARE_OS_PROTOMUX_MESHDROP_CHANNEL=0
|
|
* - BARE_OS_PROTOMUX_MESHDROP_CHANNEL=false
|
|
*
|
|
* @param {Record<string, string | undefined>} [env]
|
|
*/
|
|
export function bareOsProtMuxMeshdropChannelEnabled(
|
|
env = /** @type {Record<string, string | undefined>} */ (globalThis.process?.env || {})
|
|
) {
|
|
const raw = String(env.BARE_OS_PROTOMUX_MESHDROP_CHANNEL ?? '').trim().toLowerCase()
|
|
if (!raw) return true
|
|
if (raw === '0' || raw === 'false' || raw === 'off' || raw === 'no') return false
|
|
return true
|
|
}
|