hexo-theme-hyonline
Version:
Futuristic online store theme for Hexo.
21 lines (16 loc) • 414 B
JavaScript
const symbolsCountTime = require('../helpers/symbols-count-time')
class StatisticGenerator {
data = {}
constructor(statistics, postData) {
this.data = statistics
this.data.wordCount = symbolsCountTime(postData, true)
}
addStatistics(data) {
data.push({
path: 'api/statistic.json',
data: JSON.stringify(this.data)
})
return data
}
}
module.exports = StatisticGenerator