MCPcopy Create free account
hub / github.com/angular/dev-infra / buildConnector

Function buildConnector

github-actions/browserstack/set-browserstack-env.js:2713–2782  ·  view source on GitHub ↗
(_a)

Source from the content-addressed store, hash-verified

2711 * @deprecated
2712 */
2713 reset() {
2714 fastNow = 0;
2715 fastTimers.length = 0;
2716 clearTimeout(fastNowTimeout);
2717 fastNowTimeout = null;
2718 },
2719 /**
2720 * Exporting for testing purposes only.
2721 * Marking as deprecated to discourage any use outside of testing.
2722 * @deprecated
2723 */
2724 kFastTimer
2725 };
2726 }
2727 });
2728
2729 //
2730 var require_connect = __commonJS({
2731 ""(exports, module) {
2732 "use strict";
2733 var net = __require("net");
2734 var assert = __require("assert");
2735 var util = require_util();
2736 var { InvalidArgumentError, ConnectTimeoutError } = require_errors();
2737 var timers = require_timers();
2738 function noop() {
2739 }
2740 var tls;
2741 var SessionCache;
2742 if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) {
2743 SessionCache = class WeakSessionCache {
2744 constructor(maxCachedSessions) {
2745 this._maxCachedSessions = maxCachedSessions;
2746 this._sessionCache = /* @__PURE__ */ new Map();
2747 this._sessionRegistry = new global.FinalizationRegistry((key) => {
2748 if (this._sessionCache.size < this._maxCachedSessions) {
2749 return;
2750 }
2751 const ref = this._sessionCache.get(key);
2752 if (ref !== void 0 && ref.deref() === void 0) {
2753 this._sessionCache.delete(key);
2754 }
2755 });
2756 }
2757 get(sessionKey) {
2758 const ref = this._sessionCache.get(sessionKey);
2759 return ref ? ref.deref() : null;
2760 }
2761 set(sessionKey, session) {
2762 if (this._maxCachedSessions === 0) {
2763 return;
2764 }
2765 this._sessionCache.set(sessionKey, new WeakRef(session));
2766 this._sessionRegistry.register(session, sessionKey);
2767 }
2768 };
2769 } else {
2770 SessionCache = class SimpleSessionCache {

Callers 1

constructorMethod · 0.70

Calls 6

__objRestFunction · 0.70
__spreadValuesFunction · 0.70
__spreadPropsFunction · 0.70
getMethod · 0.45
onMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected