Function: normalizeBusSecret()
Makaio Framework / utils / normalizeBusSecret
Function: normalizeBusSecret()
Section titled “Function: normalizeBusSecret()”normalizeBusSecret(
raw):string|undefined
Defined in: ../../../packages/utils/src/normalize-bus-secret.ts:20
Normalize a raw MAKAIO_BUS_SECRET value.
undefined(variable unset) → returnsundefined- Non-empty string after trimming → returns the trimmed value
- Empty string or whitespace-only → throws, because a secret that collapses to the empty string is almost certainly a misconfiguration and must not silently fall back to unauthenticated mode.
Parameters
Section titled “Parameters”string | undefined
The raw environment variable value, or undefined when unset.
Returns
Section titled “Returns”string | undefined
The trimmed secret string, or undefined when the variable is unset.
Throws
Section titled “Throws”When the variable is set but evaluates to an empty string after trimming.