2018-08-26 21:23:57 +00:00
|
|
|
|
module.exports = {
|
|
|
|
|
/**
|
|
|
|
|
* Converts a brand title into a filename (not a full path)
|
|
|
|
|
* @param {String} title The title to convert
|
|
|
|
|
*/
|
|
|
|
|
titleToFilename: title => (
|
|
|
|
|
title.toLowerCase()
|
|
|
|
|
.replace(/\+/g, "plus")
|
|
|
|
|
.replace(/^\./, "dot-")
|
|
|
|
|
.replace(/\.$/, "-dot")
|
|
|
|
|
.replace(/\./g, "-dot-")
|
2018-09-10 15:53:59 +00:00
|
|
|
|
.replace(/^&/, "and-")
|
|
|
|
|
.replace(/&$/, "-and")
|
|
|
|
|
.replace(/&/g, "-and-")
|
2018-08-26 21:23:57 +00:00
|
|
|
|
.replace(/[ !’]/g, "")
|
|
|
|
|
)
|
2018-09-11 06:42:29 +00:00
|
|
|
|
}
|