code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
get onopen() {
return __privateGet(this, _events).open;
} | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | onopen | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/fetch.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/fetch.js | MIT |
set onopen(fn) {
if (__privateGet(this, _events).open) {
this.removeEventListener("open", __privateGet(this, _events).open);
}
if (typeof fn === "function") {
__privateGet(this, _events).open = fn;
this.addEventListener("open", fn);
} else {
__priv... | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | onopen | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/fetch.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/fetch.js | MIT |
get onmessage() {
return __privateGet(this, _events).message;
} | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | onmessage | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/fetch.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/fetch.js | MIT |
set onmessage(fn) {
if (__privateGet(this, _events).message) {
this.removeEventListener("message", __privateGet(this, _events).message);
}
if (typeof fn === "function") {
__privateGet(this, _events).message = fn;
this.addEventListener("message", fn);
} else ... | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | onmessage | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/fetch.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/fetch.js | MIT |
get onerror() {
return __privateGet(this, _events).error;
} | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | onerror | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/fetch.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/fetch.js | MIT |
set onerror(fn) {
if (__privateGet(this, _events).error) {
this.removeEventListener("error", __privateGet(this, _events).error);
}
if (typeof fn === "function") {
__privateGet(this, _events).error = fn;
this.addEventListener("error", fn);
} else {
... | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | onerror | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/fetch.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/fetch.js | MIT |
function makeDispatcher(fn) {
return (url, opts, handler) => {
if (typeof opts === "function") {
handler = opts;
opts = null;
}
if (!url || typeof url !== "string" && typeof url !== "object" && !(url instanceof URL)) {
throw new InvalidArgumentError("invalid u... | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | makeDispatcher | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/fetch.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/fetch.js | MIT |
function addDuplexToInit(options) {
return typeof options === "undefined" || typeof options === "object" && options.duplex === void 0 ? { duplex: "half", ...options } : options;
} | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | addDuplexToInit | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/fetch.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/fetch.js | MIT |
constructor(input, options) {
super(input, addDuplexToInit(options));
} | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/fetch.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/fetch.js | MIT |
async function fetch(resource, options) {
const res = await import_undici.default.fetch(resource, addDuplexToInit(options));
const response = new Response(res.body, res);
Object.defineProperty(response, "url", { value: res.url });
return response;
} | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | fetch | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/fetch.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/fetch.js | MIT |
constructor(key, value, index) {
if (index === void 0 || index >= key.length) {
throw new TypeError("Unreachable");
}
const code = this.code = key.charCodeAt(index);
if (code > 127) {
throw new TypeError("key must be ascii string");
}
if (key.length !=... | @param {string} key
@param {any} value
@param {number} index | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
add(key, value) {
const length = key.length;
if (length === 0) {
throw new TypeError("Unreachable");
}
let index = 0;
let node = this;
while (true) {
const code = key.charCodeAt(index);
if (code > 127) {
throw new TypeError("key m... | @param {string} key
@param {any} value | add | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
insert(key, value) {
if (this.node === null) {
this.node = new TstNode(key, value, 0);
} else {
this.node.add(key, value);
}
} | @param {string} key
@param {any} value | insert | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(callback, delay, arg) {
this._onTimeout = callback;
this._idleTimeout = delay;
this._timerArg = arg;
this.refresh();
} | @constructor
@param {Function} callback A function to be executed after the timer
expires.
@param {number} delay The time, in milliseconds that the timer should wait
before the specified function or code is executed.
@param {*} arg | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
refresh() {
if (this._state === NOT_IN_LIST) {
fastTimers.push(this);
}
if (!fastNowTimeout || fastTimers.length === 1) {
refreshTimeout();
}
this._state = PENDING;
} | Sets the timer's start time to the current time, and reschedules the timer
to call its callback at the previously specified duration adjusted to the
current time.
Using this on a timer that has already called its callback will reactivate
the timer.
@returns {void} | refresh | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
clear() {
this._state = TO_BE_CLEARED;
this._idleStart = -1;
} | The `clear` method cancels the timer, preventing it from executing.
@returns {void}
@private | clear | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
setTimeout(callback, delay, arg) {
return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg);
} | The setTimeout() method sets a timer which executes a function once the
timer expires.
@param {Function} callback A function to be executed after the timer
expires.
@param {number} delay The time, in milliseconds that the timer should
wait before the specified function or code is executed.
@param {*} [arg] An optional ... | setTimeout | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
clearTimeout(timeout) {
if (timeout[kFastTimer]) {
timeout.clear();
} else {
clearTimeout(timeout);
}
} | The clearTimeout method cancels an instantiated Timer previously created
by calling setTimeout.
@param {NodeJS.Timeout|FastTimer} timeout | clearTimeout | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
setFastTimeout(callback, delay, arg) {
return new FastTimer(callback, delay, arg);
} | The setFastTimeout() method sets a fastTimer which executes a function once
the timer expires.
@param {Function} callback A function to be executed after the timer
expires.
@param {number} delay The time, in milliseconds that the timer should
wait before the specified function or code is executed.
@param {*} [arg] An o... | setFastTimeout | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
now() {
return fastNow;
} | The now method returns the value of the internal fast timer clock.
@returns {number} | now | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
tick(delay = 0) {
fastNow += delay - RESOLUTION_MS + 1;
onTick();
onTick();
} | Trigger the onTick function to process the fastTimers array.
Exported for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated
@param {number} [delay=0] The delay in milliseconds to add to the now value. | tick | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
reset() {
fastNow = 0;
fastTimers.length = 0;
clearTimeout(fastNowTimeout);
fastNowTimeout = null;
} | Reset FastTimers.
Exported for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated | reset | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(maxCachedSessions) {
this._maxCachedSessions = maxCachedSessions;
this._sessionCache = /* @__PURE__ */ new Map();
this._sessionRegistry = new global.FinalizationRegistry((key) => {
if (this._sessionCache.size < this._maxCachedSessions) {
return;
... | Exporting for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get(sessionKey) {
const ref = this._sessionCache.get(sessionKey);
return ref ? ref.deref() : null;
} | Exporting for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated | get | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
set(sessionKey, session) {
if (this._maxCachedSessions === 0) {
return;
}
this._sessionCache.set(sessionKey, new WeakRef(session));
this._sessionRegistry.register(session, sessionKey);
} | Exporting for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated | set | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(maxCachedSessions) {
this._maxCachedSessions = maxCachedSessions;
this._sessionCache = /* @__PURE__ */ new Map();
} | Exporting for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get(sessionKey) {
return this._sessionCache.get(sessionKey);
} | Exporting for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated | get | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
set(sessionKey, session) {
if (this._maxCachedSessions === 0) {
return;
}
if (this._sessionCache.size >= this._maxCachedSessions) {
const { value: oldestKey } = this._sessionCache.keys().next();
this._sessionCache.delete(oldestKey);
}
... | Exporting for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated | set | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {
if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero");
... | Exporting for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated | buildConnector | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function onConnectTimeout(socket, opts) {
if (socket == null) {
return;
}
let message = "Connect Timeout Error";
if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {
message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(", ")},`;
} e... | Exporting for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated | onConnectTimeout | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function enumToMap(obj) {
const res = {};
Object.keys(obj).forEach((key) => {
const value = obj[key];
if (typeof value === "number") {
res[key] = value;
}
});
return res;
} | Exporting for testing purposes only.
Marking as deprecated to discourage any use outside of testing.
@deprecated | enumToMap | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(target, kind) {
/** @type {any} */
__privateAdd(this, _target, void 0);
/** @type {'key' | 'value' | 'key+value'} */
__privateAdd(this, _kind, void 0);
/** @type {number} */
__privateAdd(this, _index, void 0);
__privateSet(this, _target, ... | @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object
@param {unknown} target
@param {'key' | 'value' | 'key+value'} kind | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(url, {
interceptors,
maxHeaderSize,
headersTimeout,
socketTimeout,
requestTimeout,
connectTimeout,
bodyTimeout,
idleTimeout,
keepAlive,
keepAliveTimeout,
maxKeepAliveTimeout,
keepAliveMaxTimeout,
keepAliv... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get pipelining() {
return this[kPipelining];
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | pipelining | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
set pipelining(value) {
this[kPipelining] = value;
this[kResume](true);
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | pipelining | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function onError(client, err) {
if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
assert(client[kPendingIdx] === client[kRunningIdx]);
const requests = client[kQueue].splice(client[kRunningIdx]);
for (let i = 0; i < requests.length; i++) {
... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | onError | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
async function connect(client) {
assert(!client[kConnecting]);
assert(!client[kHTTPContext]);
let { host, hostname, protocol, port } = client[kUrl];
if (hostname[0] === "[") {
const idx = hostname.indexOf("]");
assert(idx !== -1);
const ip = hostname.substring(1, idx);
... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | connect | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function emitDrain(client) {
client[kNeedDrain] = 0;
client.emit("drain", client[kUrl], [client]);
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | emitDrain | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function resume(client, sync) {
if (client[kResuming] === 2) {
return;
}
client[kResuming] = 2;
_resume(client, sync);
client[kResuming] = 0;
if (client[kRunningIdx] > 256) {
client[kQueue].splice(0, client[kRunningIdx]);
client[kPendingIdx] -= client[kRunning... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | resume | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function _resume(client, sync) {
while (true) {
if (client.destroyed) {
assert(client[kPending] === 0);
return;
}
if (client[kClosedResolve] && !client[kSize]) {
client[kClosedResolve]();
client[kClosedResolve] = null;
return;
}
... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | _resume | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor() {
this.bottom = 0;
this.top = 0;
this.list = new Array(kSize);
this.next = null;
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
isEmpty() {
return this.top === this.bottom;
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | isEmpty | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
isFull() {
return (this.top + 1 & kMask) === this.bottom;
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | isFull | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
push(data) {
this.list[this.top] = data;
this.top = this.top + 1 & kMask;
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | push | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
shift() {
const nextItem = this.list[this.bottom];
if (nextItem === void 0)
return null;
this.list[this.bottom] = void 0;
this.bottom = this.bottom + 1 & kMask;
return nextItem;
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | shift | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor() {
this.head = this.tail = new FixedCircularBuffer();
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
isEmpty() {
return this.head.isEmpty();
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | isEmpty | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
push(data) {
if (this.head.isFull()) {
this.head = this.head.next = new FixedCircularBuffer();
}
this.head.push(data);
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | push | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
shift() {
const tail = this.tail;
const next = tail.shift();
if (tail.isEmpty() && tail.next !== null) {
this.tail = tail.next;
}
return next;
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | shift | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(pool) {
this[kPool] = pool;
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get connected() {
return this[kPool][kConnected];
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | connected | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get free() {
return this[kPool][kFree];
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | free | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get pending() {
return this[kPool][kPending];
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | pending | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get queued() {
return this[kPool][kQueued];
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | queued | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get running() {
return this[kPool][kRunning];
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | running | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get size() {
return this[kPool][kSize];
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | size | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor() {
super();
this[kQueue] = new FixedQueue();
this[kClients] = [];
this[kQueued] = 0;
const pool = this;
this[kOnDrain] = /* @__PURE__ */ __name(function onDrain(origin, targets) {
const queue = pool[kQueue];
let needDrain = false;
... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get stats() {
return this[kStats];
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | stats | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function defaultFactory(origin, opts) {
return new Client(origin, opts);
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | defaultFactory | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(origin, {
connections,
factory = defaultFactory,
connect,
connectTimeout,
tls,
maxCachedSessions,
socketPath,
autoSelectFamily,
autoSelectFamilyAttemptTimeout,
allowH2,
...options
} = {}) {
super();
... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function getGreatestCommonDivisor(a, b) {
if (a === 0)
return b;
while (b !== 0) {
const t = b;
b = a % b;
a = t;
}
return a;
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | getGreatestCommonDivisor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function defaultFactory(origin, opts) {
return new Pool(origin, opts);
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | defaultFactory | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(upstreams = [], { factory = defaultFactory, ...opts } = {}) {
super();
this[kOptions] = opts;
this[kIndex] = -1;
this[kCurrentWeight] = 0;
this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100;
this[kErrorPenalty] = this[kOptions].errorPenalty |... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
addUpstream(upstream) {
const upstreamOrigin = parseOrigin(upstream).origin;
if (this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true)) {
return this;
}
const pool = this[kFactory](upstreamOrigin, Object.assig... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | addUpstream | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
_updateBalancedPoolStats() {
let result = 0;
for (let i = 0; i < this[kClients].length; i++) {
result = getGreatestCommonDivisor(this[kClients][i][kWeight], result);
}
this[kGreatestCommonDivisor] = result;
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | _updateBalancedPoolStats | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
removeUpstream(upstream) {
const upstreamOrigin = parseOrigin(upstream).origin;
const pool = this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true);
if (pool) {
this[kRemoveClient](pool);
}
return this;... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | removeUpstream | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
get upstreams() {
return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p) => p[kUrl].origin);
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | upstreams | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function defaultFactory(origin, opts) {
return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts);
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | defaultFactory | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
super();
if (typeof factory !== "function") {
throw new InvalidArgumentError("factory must be a function.");
}
if (connect != null && typeof connect !== "function" && typeof connect !== "... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function defaultProtocolPort(protocol) {
return protocol === "https:" ? 443 : 80;
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | defaultProtocolPort | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function defaultFactory(origin, opts) {
return new Pool(origin, opts);
} | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | defaultFactory | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(opts) {
super();
/**
* @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
* @returns {URL}
*/
__privateAdd(this, _getUrl);
if (!opts || typeof opts === "object" && !(opts instanceof URL2) && !opts.uri) {
throw n... | @param {string|URL} url
@param {import('../../types/client.js').Client.Options} options | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
dispatch(opts, handler) {
const headers = buildHeaders(opts.headers);
throwIfProxyAuthIsSent(headers);
if (headers && !("host" in headers) && !("Host" in headers)) {
const { host } = new URL2(opts.origin);
headers.host = host;
}
return this[kAgent].dispatch(
... | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | dispatch | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function buildHeaders(headers) {
if (Array.isArray(headers)) {
const headersPair = {};
for (let i = 0; i < headers.length; i += 2) {
headersPair[headers[i]] = headers[i + 1];
}
return headersPair;
}
return headers;
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | buildHeaders | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function throwIfProxyAuthIsSent(headers) {
const existProxyAuth = headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization");
if (existProxyAuth) {
throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor");
}
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | throwIfProxyAuthIsSent | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(opts = {}) {
super();
__privateAdd(this, _getProxyAgentForUrl);
__privateAdd(this, _shouldProxy);
__privateAdd(this, _parseNoProxy);
__privateAdd(this, _noProxyChanged);
__privateAdd(this, _noProxyEnv);
__privateAdd(this, _noProxyValue, null);
... | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function calculateRetryAfterHeader(retryAfter) {
const current = Date.now();
return new Date(retryAfter).getTime() - current;
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | calculateRetryAfterHeader | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(opts, handlers) {
const { retryOptions, ...dispatchOpts } = opts;
const {
// Retry scoped
retry: retryFn,
maxRetries,
maxTimeout,
minTimeout,
timeoutFactor,
// Response scoped
methods,
errorCodes,
... | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
onRequestSent() {
if (this.handler.onRequestSent) {
this.handler.onRequestSent();
}
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | onRequestSent | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
onUpgrade(statusCode, headers, socket) {
if (this.handler.onUpgrade) {
this.handler.onUpgrade(statusCode, headers, socket);
}
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | onUpgrade | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
onConnect(abort) {
if (this.aborted) {
abort(this.reason);
} else {
this.abort = abort;
}
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | onConnect | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
onBodySent(chunk) {
if (this.handler.onBodySent)
return this.handler.onBodySent(chunk);
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | onBodySent | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
onHeaders(statusCode, rawHeaders, resume, statusMessage) {
const headers = parseHeaders(rawHeaders);
this.retryCount += 1;
if (statusCode >= 300) {
if (this.retryOpts.statusCodes.includes(statusCode) === false) {
return this.handler.onHeaders(
statusCode,
... | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | onHeaders | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
onData(chunk) {
this.start += chunk.length;
return this.handler.onData(chunk);
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | onData | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
onComplete(rawTrailers) {
this.retryCount = 0;
return this.handler.onComplete(rawTrailers);
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | onComplete | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
onError(err) {
if (this.aborted || isDisturbed(this.opts.body)) {
return this.handler.onError(err);
}
if (this.retryCount - this.retryCountCheckpoint > 0) {
this.retryCount = this.retryCountCheckpoint + (this.retryCount - this.retryCountCheckpoint);
} else {
... | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | onError | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function onRetry(err2) {
if (err2 != null || this.aborted || isDisturbed(this.opts.body)) {
return this.handler.onError(err2);
}
if (this.start !== 0) {
const headers = { range: `bytes=${this.start}-${this.end ?? ""}` };
if (this.etag != null) {
... | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | onRetry | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor(agent, options = {}) {
super(options);
__privateAdd(this, _agent, null);
__privateAdd(this, _options, null);
__privateSet(this, _agent, agent);
__privateSet(this, _options, options);
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
dispatch(opts, handler) {
const retry = new RetryHandler({
...opts,
retryOptions: __privateGet(this, _options)
}, {
dispatch: __privateGet(this, _agent).dispatch.bind(__privateGet(this, _agent)),
handler
});
return __privateGet(this, _agent).dispat... | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | dispatch | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
close() {
return __privateGet(this, _agent).close();
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | close | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
destroy() {
return __privateGet(this, _agent).destroy();
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | destroy | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
constructor({
resume,
abort,
contentType = "",
contentLength,
highWaterMark = 64 * 1024
// Same as nodejs fs streams.
}) {
super({
autoDestroy: true,
read: resume,
highWaterMark
});
this._readableState.dataEmitte... | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | constructor | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
destroy(err) {
if (!err && !this._readableState.endEmitted) {
err = new RequestAbortedError();
}
if (err) {
this[kAbort]();
}
return super.destroy(err);
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | destroy | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
_destroy(err, callback) {
if (!this[kReading]) {
setImmediate(() => {
callback(err);
});
} else {
callback(err);
}
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | _destroy | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
on(ev, ...args) {
if (ev === "data" || ev === "readable") {
this[kReading] = true;
}
return super.on(ev, ...args);
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | on | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
addListener(ev, ...args) {
return this.on(ev, ...args);
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | addListener | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
off(ev, ...args) {
const ret = super.off(ev, ...args);
if (ev === "data" || ev === "readable") {
this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0;
}
return ret;
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | off | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
removeListener(ev, ...args) {
return this.off(ev, ...args);
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | removeListener | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
push(chunk) {
if (this[kConsume] && chunk !== null) {
consumePush(this[kConsume], chunk);
return this[kReading] ? super.push(chunk) : true;
}
return super.push(chunk);
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | push | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
async text() {
return consume(this, "text");
} | @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
@returns {URL} | text | javascript | vercel/next.js | packages/next/src/compiled/@edge-runtime/primitives/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.