Files
Homarr/src/tools/migrate.ts

15 lines
363 B
TypeScript
Raw Normal View History

import { v4 as uuidv4 } from 'uuid';
2022-05-21 01:26:24 +02:00
import { Config } from './types';
export function migrateToIdConfig(config: Config): Config {
// Set the config and add an ID to all the services that don't have one
const services = config.services.map((service) => ({
...service,
id: service.id ?? uuidv4(),
2022-05-21 01:26:24 +02:00
}));
return {
...config,
services,
};
}