🚑 Fix UUID by using crypto

This commit is contained in:
ajnart
2022-05-21 01:26:24 +02:00
parent ecfb89de40
commit c3b11be2d0
5 changed files with 21 additions and 4 deletions

13
src/tools/migrate.ts Normal file
View File

@@ -0,0 +1,13 @@
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 ?? crypto.randomUUID(),
}));
return {
...config,
services,
};
}