Spaces:
Running
Running
Download node_modules/next/dist/lib/coalesced-function.js from cafe3310/ling-open-studio: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/cafe3310/ling-open-studio/resolve/main/node_modules/next/dist/lib/coalesced-function.js
- Command line
-
hf download hf://spaces/cafe3310/ling-open-studio/node_modules/next/dist/lib/coalesced-function.js
-
curl -L -o coalesced-function.js https://huggingface.co/spaces/cafe3310/ling-open-studio/resolve/main/node_modules/next/dist/lib/coalesced-function.js
1.09 kB
| ; | |
| Object.defineProperty(exports, "__esModule", { | |
| value: true | |
| }); | |
| Object.defineProperty(exports, "withCoalescedInvoke", { | |
| enumerable: true, | |
| get: function() { | |
| return withCoalescedInvoke; | |
| } | |
| }); | |
| const globalInvokeCache = new Map(); | |
| function withCoalescedInvoke(func) { | |
| return async function(key, args) { | |
| const entry = globalInvokeCache.get(key); | |
| if (entry) { | |
| return entry.then((res)=>({ | |
| isOrigin: false, | |
| value: res.value | |
| })); | |
| } | |
| async function __wrapper() { | |
| return await func.apply(undefined, args); | |
| } | |
| const future = __wrapper().then((res)=>{ | |
| globalInvokeCache.delete(key); | |
| return { | |
| isOrigin: true, | |
| value: res | |
| }; | |
| }).catch((err)=>{ | |
| globalInvokeCache.delete(key); | |
| return Promise.reject(err); | |
| }); | |
| globalInvokeCache.set(key, future); | |
| return future; | |
| }; | |
| } | |
| //# sourceMappingURL=coalesced-function.js.map |