Skip to content

validateAndMergeStorageConfig

validateAndMergeStorageConfig(input): void

Defined in: packages/core/src/media/config.ts:28

Validates a config’s media wiring.

Checks:

  1. Every upload().to and richtext().mediaCollectionSlug slug names a declared media collection.
  2. No slug is used by both a regular collection and a media collection.

Media collections arrive pre-declared on the client config as of the client/server config split, so there is no adapter list to flatten or de-duplicate here anymore — defineServerConfig() separately confirms each one’s meta.storageAdapter resolves to a registered adapter instance.

StorageValidationInput

The collections and media collections to validate against each other.

void

On any validation failure.