UNPKG

docxtemplater

Version:

.docx generator working with templates and data (like Mustache)

14 lines (11 loc) 293 B
"use strict"; function memoize(func) { const stringifyJson = JSON.stringify, cache = {}; function cachedfun() { const hash = stringifyJson(arguments); return (hash in cache) ? cache[hash] : cache[hash] = func.apply(this, arguments); } return cachedfun; } module.exports = memoize;