Download next.js/test/e2e/app-dir/app-static/cache-handler-default-export.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 700 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-static/cache-handler-default-export.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-static/cache-handler-default-export.js
-
curl -L -o cache-handler-default-export.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-static/cache-handler-default-export.js
700 Bytes
| Object.defineProperty(exports, '__esModule', { value: true }) | |
| const cache = new Map() | |
| var CacheHandler = /** @class */ (function () { | |
| function CacheHandler(options) { | |
| this.options = options | |
| this.cache = cache | |
| console.log('initialized custom cache-handler') | |
| } | |
| CacheHandler.prototype.get = function (key) { | |
| console.log('cache-handler get', key) | |
| return Promise.resolve(this.cache.get(key)) | |
| } | |
| CacheHandler.prototype.set = function (key, data) { | |
| console.log('cache-handler set', key) | |
| this.cache.set(key, { | |
| value: data, | |
| lastModified: Date.now(), | |
| }) | |
| return Promise.resolve(undefined) | |
| } | |
| return CacheHandler | |
| })() | |
| exports.default = CacheHandler | |