# watchdog/utils/normalizerootsconfig

module

<a id="functions">

## Functions

<a id="function-normalizeRootsConfig">

### `normalizeRootsConfig( sourceElementsOrData, config, defaultRootName ) → void` _(internal)_

Normalizes the editor roots configuration. It ensures that all root configurations are defined in `config.roots` and that they have `initialData` defined.

It normalizes a single-root configuration (where `config.root` is used) to a multi-root configuration (where all roots are defined in `config.roots`). This is considered a standard configuration format, so the editor features can always expect roots to be defined in `config.roots`.

It also handles legacy configuration options, such as `config.initialData`, `config.placeholder`, and `config.label`.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-watchdog/src/utils/normalizerootsconfig.ts#L32)

#### Parameters

* `sourceElementsOrData: string | HTMLElement | Record<string, string> | Record<string, HTMLElement>`
* `config: EditorConfig`
* `defaultRootName: string | false`

#### Returns

* `void`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
