initial commit, build is not working

This commit is contained in:
Konstantin Vulsonov
2018-09-18 23:16:10 +03:00
commit 024d0e3125
12 changed files with 1395 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { SVGOConfig, SvgOptimizeConfig } from '../config';
const defaultConfig: SVGOConfig = [
{
removeAttrs: {
attrs: '(width|height)'
},
},
{ removeViewBox: false }
];
export function makeConfig(config?: SvgOptimizeConfig): SVGOConfig {
if (config !== undefined) {
const { attrs, removeViewBox } = config;
if (attrs !== undefined) {
defaultConfig[0].removeAttrs.attrs = `(${attrs.replace(/,\s/g, '|')})`;
}
if (removeViewBox) {
defaultConfig[1].removeViewBox = removeViewBox;
}
}
return defaultConfig;
}