MCPcopy
hub / github.com/di-sukharev/opencommit / constructor

Method constructor

out/cli.cjs:53019–53031  ·  view source on GitHub ↗
(maxCachedSessions)

Source from the content-addressed store, hash-verified

53017 var net3 = require("net");
53018 var assert2 = require("assert");
53019 var util4 = require_util2();
53020 var { InvalidArgumentError, ConnectTimeoutError } = require_errors3();
53021 var tls2;
53022 var SessionCache;
53023 if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
53024 SessionCache = class WeakSessionCache {
53025 constructor(maxCachedSessions) {
53026 this._maxCachedSessions = maxCachedSessions;
53027 this._sessionCache = /* @__PURE__ */ new Map();
53028 this._sessionRegistry = new global.FinalizationRegistry((key) => {
53029 if (this._sessionCache.size < this._maxCachedSessions) {
53030 return;
53031 }
53032 const ref = this._sessionCache.get(key);
53033 if (ref !== void 0 && ref.deref() === void 0) {
53034 this._sessionCache.delete(key);

Callers

nothing calls this directly

Calls 3

derefMethod · 0.80
getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected