Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

32 wiersze
612 B

  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.cacheWrapper = cacheWrapper;
  6. exports.cacheWrapperSync = cacheWrapperSync;
  7. async function cacheWrapper(cache, key, fn) {
  8. const cached = cache.get(key);
  9. if (cached !== undefined) {
  10. return cached;
  11. }
  12. const result = await fn();
  13. cache.set(key, result);
  14. return result;
  15. }
  16. function cacheWrapperSync(cache, key, fn) {
  17. const cached = cache.get(key);
  18. if (cached !== undefined) {
  19. return cached;
  20. }
  21. const result = fn();
  22. cache.set(key, result);
  23. return result;
  24. }
  25. //# sourceMappingURL=cacheWrapper.js.map