diff --git a/lib/theme/view.js b/lib/theme/view.js index 317be76ff3..9fb8d32838 100644 --- a/lib/theme/view.js +++ b/lib/theme/view.js @@ -1,10 +1,28 @@ 'use strict'; const { dirname, extname, join } = require('path'); -const assignIn = require('lodash/assignIn'); const yfm = require('hexo-front-matter'); const Promise = require('bluebird'); +const assignIn = (...args) => { + const length = args.length; + const obj = args[0]; + + if (length < 2 || obj == null) return obj; + for (let index = 1; index < length; index++) { + const source = args[index]; + const keys = []; + for (const key in source) keys.push(key); + + const l = keys.length; + for (let i = 0; i < l; i++) { + const key = keys[i]; + obj[key] = source[key]; + } + } + return obj; +}; + function View(path, data) { this.path = path; this.source = join(this._theme.base, 'layout', path);