@salesforce/b2c-tooling-sdk / config / normalizeConfigKeys
Function: normalizeConfigKeys()
normalizeConfigKeys(
raw):Record<string,unknown>
Defined in: packages/b2c-tooling-sdk/src/config/mapping.ts:73
Normalizes config keys to canonical camelCase form.
Resolution order for each key:
- Check CONFIG_KEY_ALIASES for legacy/non-standard names
- Fall back to kebab→camelCase conversion
- First value wins when multiple keys resolve to the same canonical name
Parameters
raw
Record<string, unknown>
The raw config object with potentially mixed key formats
Returns
Record<string, unknown>
A new object with all keys in canonical camelCase
Example
typescript
normalizeConfigKeys({ 'client-id': 'abc', 'code-version': 'v1' });
// { clientId: 'abc', codeVersion: 'v1' }
normalizeConfigKeys({ server: 'example.com', hostname: 'other.com' });
// { hostname: 'example.com' } (first value wins)