mirror of
https://github.com/Mibew/simple-icons.git
synced 2024-11-17 19:04:13 +03:00
6ee6ba977c
* Add prepublish script Compiles icons into both static js files (icons/{filename}.js) and into a static index.js. The latter is not tree-shakeable. Closes #941, closes #751 * Add information on tree-shaking to README * Remove index.js after publishing * Change 'prepublish' to 'prepublishOnly' * Link to webpack in README * Simplify postpublish cleanup Thanks @ericcornelissen * Fix quote usage in prepublish.js * Fix quote usage in utils.js * Optimized file size of prepublish output * Improved readability of prepublish script
15 lines
399 B
JavaScript
15 lines
399 B
JavaScript
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-")
|
||
.replace(/[ !’]/g, "")
|
||
)
|
||
}
|