1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-04 18:35:17 +02:00

Server db utils changes

This commit is contained in:
Paweł Malak 2021-11-13 23:28:43 +01:00
parent 91e99e1bcc
commit d86ebe3e58
5 changed files with 36 additions and 21 deletions

19
db/utils/slugify.js Normal file
View file

@ -0,0 +1,19 @@
const slugify = () => {
const version = process.env.VERSION;
const slug = `db-${version.replace(/\./g, '')}-backup.sqlite`;
return slug;
};
const parseSlug = (slug) => {
const parts = slug.split('-');
const version = {
raw: parts[1],
parsed: parts[1].split('').join('.'),
};
return version;
};
module.exports = {
slugify,
parseSlug,
};