function toMetadataList(value) {
  if (!value) return [];
  if (value instanceof Map) return Array.from(value.values());
  if (Array.isArray(value)) return value;
  if (typeof value === "object") return Object.values(value);
  return [];
}
function listEntityMetadataFromRegistry(registry) {
  const source = registry;
  if (!source) return [];
  if (typeof source.getAll === "function") {
    const entries = toMetadataList(source.getAll());
    if (entries.length) return entries;
  }
  return toMetadataList(source.metadata);
}
function listEntityMetadata(source) {
  const holder = source;
  if (!holder || typeof holder.getMetadata !== "function") return [];
  return listEntityMetadataFromRegistry(holder.getMetadata());
}
export {
  listEntityMetadata,
  listEntityMetadataFromRegistry
};
//# sourceMappingURL=entityMetadata.js.map
