mirror of https://github.com/curbengh/hexo-yam
style: arrow function
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
This commit is contained in:
parent
37aa7f9758
commit
8531b77cfc
|
@ -45,8 +45,8 @@ function logicCss (str, data) {
|
|||
if (nanomatch.some(path, exclude, { matchBase: true })) return str
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
new CleanCSS(options).minify(str, function (err, result) {
|
||||
return new Promise((resolve, reject) => {
|
||||
new CleanCSS(options).minify(str, (err, result) => {
|
||||
if (err) return reject(err)
|
||||
let saved = ((str.length - result.styles.length) / str.length * 100).toFixed(2)
|
||||
resolve(result.styles)
|
||||
|
@ -107,7 +107,7 @@ function logicSvg () {
|
|||
assetPath.on('end', () => {
|
||||
if (assetTxt.length) {
|
||||
// Minify using svgo
|
||||
new svgo(options).optimize(assetTxt).then(function (result) {
|
||||
new svgo(options).optimize(assetTxt).then((result) => {
|
||||
// Replace the original file with the minified.
|
||||
route.set(path, result.data)
|
||||
// Logging
|
||||
|
|
Loading…
Reference in New Issue