From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- node_modules/cosmiconfig/dist/cacheWrapper.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 node_modules/cosmiconfig/dist/cacheWrapper.js (limited to 'node_modules/cosmiconfig/dist/cacheWrapper.js') diff --git a/node_modules/cosmiconfig/dist/cacheWrapper.js b/node_modules/cosmiconfig/dist/cacheWrapper.js new file mode 100644 index 00000000..38c4fcb2 --- /dev/null +++ b/node_modules/cosmiconfig/dist/cacheWrapper.js @@ -0,0 +1,19 @@ +// +'use strict'; + +function cacheWrapper (cache , key , fn ) { + if (!cache) { + return fn(); + } + + const cached = cache.get(key); + if (cached !== undefined) { + return cached; + } + + const result = fn(); + cache.set(key, result); + return result; +} + +module.exports = cacheWrapper; -- cgit v1.2.3