From d1cdd95f48b76d0195e00bc0b9c312278b1b36b8 Mon Sep 17 00:00:00 2001 From: curbengh <43627182+curbengh@users.noreply.github.com> Date: Sun, 11 Aug 2019 23:23:08 +0930 Subject: [PATCH] refactor: arrow function --- lib/generator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/generator.js b/lib/generator.js index 1cea34f..f7a1d24 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -4,7 +4,7 @@ const micromatch = require('micromatch'); const template = require('./template'); module.exports = function(locals) { - const config = this.config; + const {config} = this; let skipRenderList = [ '**/*.js', '**/*.css' @@ -17,10 +17,10 @@ module.exports = function(locals) { } const posts = [].concat(locals.posts.toArray(), locals.pages.toArray()) - .filter(function(post) { + .filter(post => { return post.sitemap !== false && !isMatch(post.source, skipRenderList); }) - .sort(function(a, b) { + .sort((a, b) => { return b.updated - a.updated; });