Move "getAppMetadataFrom" to "MetadataMigrations"

This commit is contained in:
schroda
2025-01-04 21:27:51 +01:00
parent 3782091601
commit b7971f5183
2 changed files with 17 additions and 21 deletions

View File

@@ -276,19 +276,3 @@ export function getMetadataFrom<METADATA extends Partial<Metadata<AppMetadataKey
return appMetadata;
}
export const getAppMetadataFrom = (
meta: Metadata,
prefixes: string[] = [],
appPrefix: string = APP_METADATA_KEY_PREFIX,
): Metadata => {
const appMetadata: Metadata = {};
Object.entries(meta).forEach(([key, value]) => {
if (key.startsWith([appPrefix, ...prefixes].join('_'))) {
appMetadata[key] = value;
}
});
return appMetadata;
};