UNPKG

jest-allure2-reporter

Version:
24 lines 791 B
"use strict"; /* eslint-disable @typescript-eslint/no-explicit-any */ Object.defineProperty(exports, "__esModule", { value: true }); exports.weakMemoize = weakMemoize; function weakMemoize(function_) { const nullCache = new Map(); const weakCache = new WeakMap(); const memoizedFunction = ((argument) => { if (argument == null) { if (!nullCache.has(argument)) { nullCache.set(argument, function_(argument)); } return nullCache.get(argument); } else { if (!weakCache.has(argument)) { weakCache.set(argument, function_(argument)); } return weakCache.get(argument); } }); return memoizedFunction; } //# sourceMappingURL=weakMemoize.js.map