Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@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:

  1. Check CONFIG_KEY_ALIASES for legacy/non-standard names
  2. Fall back to kebab→camelCase conversion
  3. 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)

Released under the Apache-2.0 License.