mithril-icon-builder
Version:
Converts SVG icons to Mithril elements.
18 lines (15 loc) • 549 B
JavaScript
function defaultDestRewriter(pathObj, innerPath, options) {
var path = require('path');
var fileName = pathObj.base;
if (options.fileSuffix) {
fileName.replace(options.fileSuffix, '.svg');
} else {
fileName = fileName.replace('.svg', '.js');
}
innerPath = innerPath.replace(/-/g, '');
innerPath = innerPath.replace(/\./g, '_');
innerPath = innerPath.replace(/\s+/g, '_');
fileName = fileName.replace(/_/g, '-');
return path.join(innerPath, fileName);
}
module.exports = defaultDestRewriter;