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
|
if (nanomatch.some(path, exclude, { matchBase: true })) return str
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise((resolve, reject) => {
|
||||||
new CleanCSS(options).minify(str, function (err, result) {
|
new CleanCSS(options).minify(str, (err, result) => {
|
||||||
if (err) return reject(err)
|
if (err) return reject(err)
|
||||||
let saved = ((str.length - result.styles.length) / str.length * 100).toFixed(2)
|
let saved = ((str.length - result.styles.length) / str.length * 100).toFixed(2)
|
||||||
resolve(result.styles)
|
resolve(result.styles)
|
||||||
|
@ -107,7 +107,7 @@ function logicSvg () {
|
||||||
assetPath.on('end', () => {
|
assetPath.on('end', () => {
|
||||||
if (assetTxt.length) {
|
if (assetTxt.length) {
|
||||||
// Minify using svgo
|
// 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.
|
// Replace the original file with the minified.
|
||||||
route.set(path, result.data)
|
route.set(path, result.data)
|
||||||
// Logging
|
// Logging
|
||||||
|
|
Loading…
Reference in New Issue