flame/db/utils/slugify.js
2021-11-13 23:28:43 +01:00

20 lines
364 B
JavaScript

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,
};