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 |
|---|---|---|---|---|---|---|---|
constructor(type, eventInitDict = {}) {
var __super = (...args) => {
super(...args);
__privateAdd(this, _eventInit, void 0);
return this;
};
if (type === kConstruct) {
__super(arguments[1], arguments[2]);
webidl.util.markAsUncloneable(this);
... | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | 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 |
__super = (...args) => {
super(...args);
__privateAdd(this, _eventInit, void 0);
return this;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | __super | 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 data() {
webidl.brandCheck(this, _MessageEvent);
return __privateGet(this, _eventInit).data;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | data | 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 origin() {
webidl.brandCheck(this, _MessageEvent);
return __privateGet(this, _eventInit).origin;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | origin | 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 lastEventId() {
webidl.brandCheck(this, _MessageEvent);
return __privateGet(this, _eventInit).lastEventId;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | lastEventId | 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 source() {
webidl.brandCheck(this, _MessageEvent);
return __privateGet(this, _eventInit).source;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | source | 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 ports() {
webidl.brandCheck(this, _MessageEvent);
if (!Object.isFrozen(__privateGet(this, _eventInit).ports)) {
Object.freeze(__privateGet(this, _eventInit).ports);
}
return __privateGet(this, _eventInit).ports;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | ports | 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 |
initMessageEvent(type, bubbles = false, cancelable = false, data = null, origin = "", lastEventId = "", source = null, ports = []) {
webidl.brandCheck(this, _MessageEvent);
webidl.argumentLengthCheck(arguments, 1, "MessageEvent.initMessageEvent");
return new _MessageEvent(type, {
bubbl... | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | initMessageEvent | 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 |
static createFastMessageEvent(type, init) {
const messageEvent = new _MessageEvent(kConstruct, type, init);
__privateSet(messageEvent, _eventInit, init);
__privateGet(messageEvent, _eventInit).data ??= null;
__privateGet(messageEvent, _eventInit).origin ??= "";
__privateGet(messa... | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | createFastMessageEvent | 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(type, eventInitDict = {}) {
const prefix = "CloseEvent constructor";
webidl.argumentLengthCheck(arguments, 1, prefix);
type = webidl.converters.DOMString(type, prefix, "type");
eventInitDict = webidl.converters.CloseEventInit(eventInitDict);
super(type, eventInitDict)... | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | 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 wasClean() {
webidl.brandCheck(this, _CloseEvent);
return __privateGet(this, _eventInit2).wasClean;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | wasClean | 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 code() {
webidl.brandCheck(this, _CloseEvent);
return __privateGet(this, _eventInit2).code;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | code | 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 reason() {
webidl.brandCheck(this, _CloseEvent);
return __privateGet(this, _eventInit2).reason;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | reason | 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(type, eventInitDict) {
const prefix = "ErrorEvent constructor";
webidl.argumentLengthCheck(arguments, 1, prefix);
super(type, eventInitDict);
__privateAdd(this, _eventInit3, void 0);
webidl.util.markAsUncloneable(this);
type = webidl.converters.DOMString(type,... | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | 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 message() {
webidl.brandCheck(this, _ErrorEvent);
return __privateGet(this, _eventInit3).message;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | message | 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 filename() {
webidl.brandCheck(this, _ErrorEvent);
return __privateGet(this, _eventInit3).filename;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | filename | 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 lineno() {
webidl.brandCheck(this, _ErrorEvent);
return __privateGet(this, _eventInit3).lineno;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | lineno | 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 colno() {
webidl.brandCheck(this, _ErrorEvent);
return __privateGet(this, _eventInit3).colno;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | colno | 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 error() {
webidl.brandCheck(this, _ErrorEvent);
return __privateGet(this, _eventInit3).error;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | error | 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 isConnecting(ws) {
return ws[kReadyState] === states.CONNECTING;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isConnecting | 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 isEstablished(ws) {
return ws[kReadyState] === states.OPEN;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isEstablished | 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 isClosing(ws) {
return ws[kReadyState] === states.CLOSING;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isClosing | 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 isClosed(ws) {
return ws[kReadyState] === states.CLOSED;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isClosed | 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 fireEvent(e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {
const event = eventFactory(e, eventInitDict);
target.dispatchEvent(event);
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | fireEvent | 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 websocketMessageReceived(ws, type, data) {
if (ws[kReadyState] !== states.OPEN) {
return;
}
let dataForEvent;
if (type === opcodes.TEXT) {
try {
dataForEvent = utf8Decode(data);
} catch {
failWebsocketConnection(ws, "Received invalid UTF-8 in ... | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | websocketMessageReceived | 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 toArrayBuffer(buffer) {
if (buffer.byteLength === buffer.buffer.byteLength) {
return buffer.buffer;
}
return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | toArrayBuffer | 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 isValidSubprotocol(protocol) {
if (protocol.length === 0) {
return false;
}
for (let i = 0; i < protocol.length; ++i) {
const code = protocol.charCodeAt(i);
if (code < 33 || // CTL, contains SP (0x20) and HT (0x09)
code > 126 || code === 34 || // "
code... | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isValidSubprotocol | 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 isValidStatusCode(code) {
if (code >= 1e3 && code < 1015) {
return code !== 1004 && // reserved
code !== 1005 && // "MUST NOT be set as a status code"
code !== 1006;
}
return code >= 3e3 && code <= 4999;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isValidStatusCode | 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 failWebsocketConnection(ws, reason) {
const { [kController]: controller, [kResponse]: response } = ws;
controller.abort();
if (response?.socket && !response.socket.destroyed) {
response.socket.destroy();
}
if (reason) {
fireEvent("error", ws, (type, init) => new Er... | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | failWebsocketConnection | 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 isControlFrame(opcode) {
return opcode === opcodes.CLOSE || opcode === opcodes.PING || opcode === opcodes.PONG;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isControlFrame | 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 isContinuationFrame(opcode) {
return opcode === opcodes.CONTINUATION;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isContinuationFrame | 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 isTextBinaryFrame(opcode) {
return opcode === opcodes.TEXT || opcode === opcodes.BINARY;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isTextBinaryFrame | 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 isValidOpcode(opcode) {
return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode);
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isValidOpcode | 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 parseExtensions(extensions) {
const position = { position: 0 };
const extensionList = /* @__PURE__ */ new Map();
while (position.position < extensions.length) {
const pair = collectASequenceOfCodePointsFast(";", extensions, position);
const [name, value = ""] = pair.split("=")... | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | parseExtensions | 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 isValidClientWindowBits(value) {
for (let i = 0; i < value.length; i++) {
const byte = value.charCodeAt(i);
if (byte < 48 || byte > 57) {
return false;
}
}
return true;
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | isValidClientWindowBits | 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 generateMask() {
if (bufIdx === BUFFER_SIZE) {
bufIdx = 0;
crypto.randomFillSync(buffer ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE);
}
return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]];
} | @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
@returns {Promise<string[]>} | generateMask | 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 |
_write(chunk, _, callback) {
__privateGet(this, _buffers).push(chunk);
__privateSet(this, _byteOffset, __privateGet(this, _byteOffset) + chunk.length);
__privateSet(this, _loop, true);
this.run(callback);
} | @param {Buffer} chunk
@param {() => void} callback | _write | 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 |
run(callback) {
while (__privateGet(this, _loop)) {
if (__privateGet(this, _state) === parserStates.INFO) {
if (__privateGet(this, _byteOffset) < 2) {
return callback();
}
const buffer = this.consume(2);
const fin = (buffer[0] & 128) !== 0;... | Runs whenever a new chunk is received.
Callback is called whenever there are no more chunks buffering,
or not enough bytes are buffered to parse. | run | 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 |
consume(n) {
if (n > __privateGet(this, _byteOffset)) {
throw new Error("Called consume() before buffers satiated.");
} else if (n === 0) {
return emptyBuffer;
}
if (__privateGet(this, _buffers)[0].length === n) {
__privateSet(this, _byteOffset, __privateGet... | Take n bytes from the buffered Buffers
@param {number} n
@returns {Buffer} | consume | 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 |
parseCloseBody(data) {
assert(data.length !== 1);
let code;
if (data.length >= 2) {
code = data.readUInt16BE(0);
}
if (code !== void 0 && !isValidStatusCode(code)) {
return { code: 1002, reason: "Invalid status code", error: true };
}
let reaso... | Take n bytes from the buffered Buffers
@param {number} n
@returns {Buffer} | parseCloseBody | 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 |
parseControlFrame(body) {
const { opcode, payloadLength } = __privateGet(this, _info);
if (opcode === opcodes.CLOSE) {
if (payloadLength === 1) {
failWebsocketConnection(this.ws, "Received close frame with a 1-byte body.");
return false;
}
__privateG... | Parses control frames.
@param {Buffer} body | parseControlFrame | 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 closingInfo() {
return __privateGet(this, _info).closeInfo;
} | Parses control frames.
@param {Buffer} body | closingInfo | 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(socket) {
__privateAdd(this, _run);
/**
* @type {FixedQueue}
*/
__privateAdd(this, _queue, new FixedQueue());
/**
* @type {boolean}
*/
__privateAdd(this, _running, false);
/** @type {import('node:net').Socket} */
__p... | Parses control frames.
@param {Buffer} body | 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, protocols = []) {
super();
/**
* @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
*/
__privateAdd(this, _onConnectionEstablished);
__privateAdd(this, _events, {
open: null,
error: null,
close: null,
... | @param {string} url
@param {string|string[]} protocols | 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 |
close(code = void 0, reason = void 0) {
webidl.brandCheck(this, _WebSocket);
const prefix = "WebSocket.close";
if (code !== void 0) {
code = webidl.converters["unsigned short"](code, prefix, "code", { clamp: true });
}
if (reason !== void 0) {
reason = webidl.... | @see https://websockets.spec.whatwg.org/#dom-websocket-close
@param {number|undefined} code
@param {string|undefined} reason | 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 |
send(data) {
webidl.brandCheck(this, _WebSocket);
const prefix = "WebSocket.send";
webidl.argumentLengthCheck(arguments, 1, prefix);
data = webidl.converters.WebSocketSendData(data, prefix, "data");
if (isConnecting(this)) {
throw new DOMException("Sent before connected... | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | send | 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 readyState() {
webidl.brandCheck(this, _WebSocket);
return this[kReadyState];
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | readyState | 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 bufferedAmount() {
webidl.brandCheck(this, _WebSocket);
return __privateGet(this, _bufferedAmount);
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | bufferedAmount | 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 url() {
webidl.brandCheck(this, _WebSocket);
return URLSerializer(this[kWebSocketURL]);
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | url | 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 extensions() {
webidl.brandCheck(this, _WebSocket);
return __privateGet(this, _extensions);
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | extensions | 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 protocol() {
webidl.brandCheck(this, _WebSocket);
return __privateGet(this, _protocol);
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | protocol | 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 onopen() {
webidl.brandCheck(this, _WebSocket);
return __privateGet(this, _events).open;
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | onopen | 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 onopen(fn) {
webidl.brandCheck(this, _WebSocket);
if (__privateGet(this, _events).open) {
this.removeEventListener("open", __privateGet(this, _events).open);
}
if (typeof fn === "function") {
__privateGet(this, _events).open = fn;
this.addEventListener("... | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | onopen | 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 onerror() {
webidl.brandCheck(this, _WebSocket);
return __privateGet(this, _events).error;
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | 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 |
set onerror(fn) {
webidl.brandCheck(this, _WebSocket);
if (__privateGet(this, _events).error) {
this.removeEventListener("error", __privateGet(this, _events).error);
}
if (typeof fn === "function") {
__privateGet(this, _events).error = fn;
this.addEventListe... | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | 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 |
get onclose() {
webidl.brandCheck(this, _WebSocket);
return __privateGet(this, _events).close;
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | onclose | 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 onclose(fn) {
webidl.brandCheck(this, _WebSocket);
if (__privateGet(this, _events).close) {
this.removeEventListener("close", __privateGet(this, _events).close);
}
if (typeof fn === "function") {
__privateGet(this, _events).close = fn;
this.addEventListe... | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | onclose | 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 onmessage() {
webidl.brandCheck(this, _WebSocket);
return __privateGet(this, _events).message;
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | onmessage | 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 onmessage(fn) {
webidl.brandCheck(this, _WebSocket);
if (__privateGet(this, _events).message) {
this.removeEventListener("message", __privateGet(this, _events).message);
}
if (typeof fn === "function") {
__privateGet(this, _events).message = fn;
this.add... | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | onmessage | 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 binaryType() {
webidl.brandCheck(this, _WebSocket);
return this[kBinaryType];
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | binaryType | 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 binaryType(type) {
webidl.brandCheck(this, _WebSocket);
if (type !== "blob" && type !== "arraybuffer") {
this[kBinaryType] = "blob";
} else {
this[kBinaryType] = type;
}
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | binaryType | 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 onParserError(err) {
let message;
let code;
if (err instanceof CloseEvent) {
message = err.reason;
code = err.code;
} else {
message = err.message;
}
fireEvent("error", this, () => new ErrorEvent("error", { error: err, message }));
closeWebSocke... | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | onParserError | 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 isValidLastEventId(value) {
return value.indexOf("\0") === -1;
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | isValidLastEventId | 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 isASCIINumber(value) {
if (value.length === 0)
return false;
for (let i = 0; i < value.length; i++) {
if (value.charCodeAt(i) < 48 || value.charCodeAt(i) > 57)
return false;
}
return true;
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | isASCIINumber | 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 delay(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms).unref();
});
} | @see https://websockets.spec.whatwg.org/#dom-websocket-send
@param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data | delay | 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(options = {}) {
options.readableObjectMode = true;
super(options);
this.state = options.eventSourceSettings || {};
if (options.push) {
this.push = options.push;
}
} | @param {object} options
@param {eventSourceSettings} options.eventSourceSettings
@param {Function} [options.push] | 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 |
_transform(chunk, _encoding, callback) {
if (chunk.length === 0) {
callback();
return;
}
if (this.buffer) {
this.buffer = Buffer.concat([this.buffer, chunk]);
} else {
this.buffer = chunk;
}
if (this.checkBOM) {
switch (th... | @param {Buffer} chunk
@param {string} _encoding
@param {Function} callback
@returns {void} | _transform | 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 |
parseLine(line, event) {
if (line.length === 0) {
return;
}
const colonPosition = line.indexOf(COLON);
if (colonPosition === 0) {
return;
}
let field = "";
let value = "";
if (colonPosition !== -1) {
field = line.subarray(0, c... | @param {Buffer} line
@param {EventStreamEvent} event | parseLine | 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, eventSourceInitDict = {}) {
super();
__privateAdd(this, _connect);
/**
* @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model
* @returns {Promise<void>}
*/
__privateAdd(this, _reconnect);
__privateAdd... | Creates a new EventSource object.
@param {string} url
@param {EventSourceInit} [eventSourceInitDict]
@see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface | 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 readyState() {
return __privateGet(this, _readyState);
} | Returns the state of this EventSource object's connection. It can have the
values described below.
@returns {0|1|2}
@readonly | readyState | 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 url() {
return __privateGet(this, _url);
} | Returns the URL providing the event stream.
@readonly
@returns {string} | url | 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 withCredentials() {
return __privateGet(this, _withCredentials);
} | Returns a boolean indicating whether the EventSource object was
instantiated with CORS credentials set (true), or not (false, the default). | withCredentials | 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() {
webidl.brandCheck(this, _EventSource);
if (__privateGet(this, _readyState) === CLOSED)
return;
__privateSet(this, _readyState, CLOSED);
__privateGet(this, _controller).abort();
__privateSet(this, _request, null);
} | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | 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 |
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/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.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/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.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/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.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/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.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/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.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/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.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/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.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/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.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/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.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/load.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/@edge-runtime/primitives/load.js | MIT |
function load(scopedContext = {}) {
const context = {};
Object.assign(context, {
TextDecoder,
TextEncoder,
TextEncoderStream,
TextDecoderStream,
atob,
btoa,
performance
});
const consoleImpl = requireWithFakeGlobalScope({
context,
id: "console.js",
sourceCode: require("./... | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | load | 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 getCrypto(scopedContext) {
if (typeof SubtleCrypto !== "undefined" || scopedContext.SubtleCrypto) {
return {
crypto: scopedContext.crypto || globalThis.crypto,
Crypto: scopedContext.Crypto || globalThis.Crypto,
CryptoKey: scopedContext.CryptoKey || globalThis.CryptoKey,
SubtleCryp... | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | getCrypto | 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 requireWithFakeGlobalScope(params) {
const getModuleCode = `(function(module,exports,require,globalThis,${Object.keys(
params.scopedContext
).join(",")}) {${params.sourceCode}
})`;
const module = {
exports: {},
loaded: false,
id: params.id
};
const moduleRequire = (import_module.defau... | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | requireWithFakeGlobalScope | 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 throwingRequire(pathToRequire) {
if (pathToRequire.startsWith("./")) {
const moduleName = pathToRequire.replace(/^\.\//, "");
if (!params.cache || !params.cache.has(moduleName)) {
throw new Error(`Cannot find module '${moduleName}'`);
}
return params.cache.get(moduleName).ex... | Closes the connection, if any, and sets the readyState attribute to
CLOSED. | throwingRequire | 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._array = [];
this._set = new Map();
} | A data structure which is a combination of an array and a set. Adding a new
member is O(1), testing for membership is O(1), and finding the index of an
element is O(1). Removing elements from the set is not supported. Only
strings are supported for membership. | constructor | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
static fromArray(aArray, aAllowDuplicates) {
const set = new ArraySet();
for (let i = 0, len = aArray.length; i < len; i++) {
set.add(aArray[i], aAllowDuplicates);
}
return set;
} | Static method for creating ArraySet instances from an existing array. | fromArray | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
size() {
return this._set.size;
} | Return how many unique items are in this ArraySet. If duplicates have been
added, than those do not count towards the size.
@returns Number | size | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
add(aStr, aAllowDuplicates) {
const isDuplicate = this.has(aStr);
const idx = this._array.length;
if (!isDuplicate || aAllowDuplicates) {
this._array.push(aStr);
}
if (!isDuplicate) {
this._set.set(aStr, idx);
}
} | Add the given string to this set.
@param String aStr | add | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
has(aStr) {
return this._set.has(aStr);
} | Is the given string a member of this set?
@param String aStr | has | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
indexOf(aStr) {
const idx = this._set.get(aStr);
if (idx >= 0) {
return idx;
}
throw new Error('"' + aStr + '" is not in the set.');
} | What is the index of the given string in the array?
@param String aStr | indexOf | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
at(aIdx) {
if (aIdx >= 0 && aIdx < this._array.length) {
return this._array[aIdx];
}
throw new Error("No element indexed by " + aIdx);
} | What is the element at the given index?
@param Number aIdx | at | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
toArray() {
return this._array.slice();
} | Returns the array representation of this set (which has the proper indices
indicated by indexOf). Note that this is a copy of the internal array used
for storing the members so that no one can mess with internal state. | toArray | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
function toVLQSigned(aValue) {
return aValue < 0
? ((-aValue) << 1) + 1
: (aValue << 1) + 0;
} | Converts from a two-complement value to a value where the sign bit is
placed in the least significant bit. For example, as decimals:
1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
2 becomes 4 (100 binary), -2 becomes 5 (101 binary) | toVLQSigned | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
function fromVLQSigned(aValue) {
const isNegative = (aValue & 1) === 1;
const shifted = aValue >> 1;
return isNegative
? -shifted
: shifted;
} | Converts to a two-complement value from a value where the sign bit is
placed in the least significant bit. For example, as decimals:
2 (10 binary) becomes 1, 3 (11 binary) becomes -1
4 (100 binary) becomes 2, 5 (101 binary) becomes -2 | fromVLQSigned | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
// This function terminates when one of the following is true:
//
// 1. We find the exact element we are looking for.
//
// 2. We did not find the exact element, but we can return the index of
// the next-closest element.
... | Recursive implementation of binary search.
@param aLow Indices here and lower do not contain the needle.
@param aHigh Indices here and higher do not contain the needle.
@param aNeedle The element being searched for.
@param aHaystack The non-empty array being searched.
@param aCompare Function which takes two elements ... | recursiveSearch | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
function generatedPositionAfter(mappingA, mappingB) {
// Optimized for most common case
const lineA = mappingA.generatedLine;
const lineB = mappingB.generatedLine;
const columnA = mappingA.generatedColumn;
const columnB = mappingB.generatedColumn;
return lineB > lineA || lineB == lineA && columnB >= columnA... | Determine whether mappingB is after mappingA with respect to generated
position. | generatedPositionAfter | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
constructor() {
this._array = [];
this._sorted = true;
// Serves as infimum
this._last = {generatedLine: -1, generatedColumn: 0};
} | A data structure to provide a sorted view of accumulated mappings in a
performance conscious manner. It trades a negligible overhead in general
case for a large speedup in case of mappings being added in order. | constructor | javascript | vercel/next.js | packages/next/src/compiled/source-map08/source-map.js | https://github.com/vercel/next.js/blob/master/packages/next/src/compiled/source-map08/source-map.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.