MCPcopy Create free account
hub / github.com/TheNetsky/Microsoft-Rewards-Script / envBoolWithLegacy

Function envBoolWithLegacy

scripts/utils.js:150–160  ·  view source on GitHub ↗
(primary, legacy, fallback)

Source from the content-addressed store, hash-verified

148
149const deprecationWarned = new Set()
150function envBoolWithLegacy(primary, legacy, fallback) {
151 if (envStr(primary) !== undefined) return envBool(primary, fallback)
152 if (envStr(legacy) !== undefined) {
153 if (!deprecationWarned.has(legacy)) {
154 deprecationWarned.add(legacy)
155 log('WARN', `${legacy} is deprecated; rename it to ${primary}.`)
156 }
157 return envBool(legacy, fallback)
158 }
159 return fallback
160}
161
162function envInt(key, fallback) {
163 const v = envStr(key)

Callers 1

loadAccountsFromEnvFunction · 0.70

Calls 3

logFunction · 0.85
envStrFunction · 0.70
envBoolFunction · 0.70

Tested by

no test coverage detected