MCPcopy Create free account
hub / github.com/mscdex/ssh2 / constructor

Method constructor

lib/agent.js:1019–1028  ·  view source on GitHub ↗
(agent)

Source from the content-addressed store, hash-verified

1017const SYM_AGENT_CBS = Symbol('Agent Init Callbacks');
1018class AgentContext {
1019 constructor(agent) {
1020 if (typeof agent === 'string')
1021 agent = createAgent(agent);
1022 else if (!isAgent(agent))
1023 throw new Error('Invalid agent argument');
1024 this[SYM_AGENT] = agent;
1025 this[SYM_AGENT_KEYS] = null;
1026 this[SYM_AGENT_KEYS_IDX] = -1;
1027 this[SYM_AGENT_CBS] = null;
1028 }
1029 init(cb) {
1030 if (typeof cb !== 'function')
1031 cb = noop;

Callers

nothing calls this directly

Calls 2

createAgentFunction · 0.85
isAgentFunction · 0.85

Tested by

no test coverage detected