From c8fee535b310528fdc01a7761e5df5edf91f9c8c Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sun, 27 Oct 2019 22:48:29 +0800 Subject: [PATCH] refactor: drop lodash for new-post-path filter --- lib/plugins/filter/new_post_path.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugins/filter/new_post_path.js b/lib/plugins/filter/new_post_path.js index 4773c0cca1..e47586fda0 100644 --- a/lib/plugins/filter/new_post_path.js +++ b/lib/plugins/filter/new_post_path.js @@ -2,7 +2,6 @@ const { join, extname } = require('path'); const moment = require('moment'); -const defaults = require('lodash/defaults'); const Promise = require('bluebird'); const { Permalink } = require('hexo-util'); const fs = require('hexo-fs'); @@ -74,7 +73,8 @@ function newPostPathFilter(data = {}, replace) { } target = join(postDir, permalink.stringify( - defaults(filenameData, permalinkDefaults))); + Object.assign(permalinkDefaults, filenameData) + )); } } } else {