import type { ISavedObjectTypeRegistry } from 'src/core/server' ; import { SavedObjectsUtils } from '../../../../../src/core/server' ; export const getDescriptorNamespace = ( typeRegistry , type , namespace ? ) => { const descriptorNamespace = typeRegistry . isSingleNamespace ( type ) ? Array . isArray ( namespace ) ? namespace [ 0 ] : namespace : undefined ; return normalizeNamespace ( descriptorNamespace ) ; } ; /**
 * Ensure that a namespace is always in its namespace ID representation.
 * This allows `'default'` to be used interchangeably with `undefined`.
 */ export const normalizeNamespace = ( namespace ? ) => namespace === undefined ? namespace : SavedObjectsUtils . namespaceStringToId ( namespace ) ;