Support regex in metadata value migration
This commit is contained in:
@@ -20,7 +20,7 @@ export interface IMetadataMigration {
|
||||
* Otherwise, all metadata keys will get migrated.
|
||||
*/
|
||||
key?: string;
|
||||
oldValue: string;
|
||||
oldValue: string | RegExp;
|
||||
newValue: string;
|
||||
}[];
|
||||
keys?: { oldKey: string; newKey: string }[];
|
||||
|
||||
@@ -59,7 +59,7 @@ const applyMetadataValueMigration = (meta: Metadata, migration: IMetadataMigrati
|
||||
|
||||
metadataValueChanges.forEach(({ key, oldValue, newValue }) => {
|
||||
const migrateValue = (metaKey: string) => {
|
||||
if (meta[metaKey] === oldValue) {
|
||||
if (meta[metaKey].match(oldValue)) {
|
||||
migratedMetadata[metaKey] = newValue;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user