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 |
|---|---|---|---|---|---|---|---|
function headerValueNormalize (potentialValue) {
// To normalize a byte sequence potentialValue, remove
// any leading and trailing HTTP whitespace bytes from
// potentialValue.
let i = 0; let j = potentialValue.length
while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
while... | @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
@param {string} potentialValue | headerValueNormalize | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
keys () {
webidl.brandCheck(this, Headers)
if (this[kGuard] === 'immutable') {
const value = this[kHeadersSortedMap]
return makeIterator(() => value, 'Headers',
'key')
}
return makeIterator(
() => [...this[kHeadersSortedMap].values()],
'Headers',
'key'
)
} | @param {(value: string, key: string, self: Headers) => void} callbackFn
@param {unknown} thisArg | keys | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
values () {
webidl.brandCheck(this, Headers)
if (this[kGuard] === 'immutable') {
const value = this[kHeadersSortedMap]
return makeIterator(() => value, 'Headers',
'value')
}
return makeIterator(
() => [...this[kHeadersSortedMap].values()],
'Headers',
'value'
)... | @param {(value: string, key: string, self: Headers) => void} callbackFn
@param {unknown} thisArg | values | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
entries () {
webidl.brandCheck(this, Headers)
if (this[kGuard] === 'immutable') {
const value = this[kHeadersSortedMap]
return makeIterator(() => value, 'Headers',
'key+value')
}
return makeIterator(
() => [...this[kHeadersSortedMap].values()],
'Headers',
'key+val... | @param {(value: string, key: string, self: Headers) => void} callbackFn
@param {unknown} thisArg | entries | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
forEach (callbackFn, thisArg = globalThis) {
webidl.brandCheck(this, Headers)
webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
if (typeof callbackFn !== 'function') {
throw new TypeError(
"Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.... | @param {(value: string, key: string, self: Headers) => void} callbackFn
@param {unknown} thisArg | forEach | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function requestCurrentURL (request) {
return request.urlList[request.urlList.length - 1]
} | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | requestCurrentURL | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isErrorLike (object) {
return object instanceof Error || (
object?.constructor?.name === 'Error' ||
object?.constructor?.name === 'DOMException'
)
} | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | isErrorLike | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isValidReasonPhrase (statusText) {
for (let i = 0; i < statusText.length; ++i) {
const c = statusText.charCodeAt(i)
if (
!(
(
c === 0x09 || // HTAB
(c >= 0x20 && c <= 0x7e) || // SP / VCHAR
(c >= 0x80 && c <= 0xff)
) // obs-text
)
) {
... | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | isValidReasonPhrase | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isTokenCharCode (c) {
switch (c) {
case 0x22:
case 0x28:
case 0x29:
case 0x2c:
case 0x2f:
case 0x3a:
case 0x3b:
case 0x3c:
case 0x3d:
case 0x3e:
case 0x3f:
case 0x40:
case 0x5b:
case 0x5c:
case 0x5d:
case 0x7b:
case 0x7d:
// DQUOTE and... | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | isTokenCharCode | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isValidHTTPToken (characters) {
if (characters.length === 0) {
return false
}
for (let i = 0; i < characters.length; ++i) {
if (!isTokenCharCode(characters.charCodeAt(i))) {
return false
}
}
return true
} | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | isValidHTTPToken | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isValidHeaderName (potentialValue) {
return isValidHTTPToken(potentialValue)
} | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | isValidHeaderName | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isValidHeaderValue (potentialValue) {
// - Has no leading or trailing HTTP tab or space bytes.
// - Contains no 0x00 (NUL) or HTTP newline bytes.
if (
potentialValue.startsWith('\t') ||
potentialValue.startsWith(' ') ||
potentialValue.endsWith('\t') ||
potentialValue.endsWith(' ')
) {
... | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | isValidHeaderValue | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function crossOriginResourcePolicyCheck () {
// TODO
return 'allowed'
} | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | crossOriginResourcePolicyCheck | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function corsCheck () {
// TODO
return 'success'
} | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | corsCheck | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function TAOCheck () {
// TODO
return 'success'
} | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | TAOCheck | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
// TODO
return performance.now()
} | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | coarsenedSharedCurrentTime | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function createOpaqueTimingInfo (timingInfo) {
return {
startTime: timingInfo.startTime ?? 0,
redirectStartTime: 0,
redirectEndTime: 0,
postRedirectStartTime: timingInfo.startTime ?? 0,
finalServiceWorkerStartTime: 0,
finalNetworkResponseStartTime: 0,
finalNetworkRequestStartTime: 0,
e... | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | createOpaqueTimingInfo | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function makePolicyContainer () {
// Note: the fetch spec doesn't make use of embedder policy or CSP list
return {
referrerPolicy: 'strict-origin-when-cross-origin'
}
} | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | makePolicyContainer | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function clonePolicyContainer (policyContainer) {
return {
referrerPolicy: policyContainer.referrerPolicy
}
} | @see https://fetch.spec.whatwg.org/#header-value
@param {string} potentialValue | clonePolicyContainer | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isURLPotentiallyTrustworthy (url) {
if (!(url instanceof URL)) {
return false
}
// If child of about, return true
if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
return true
}
// If scheme is data, return true
if (url.protocol === 'data:') return true
// If file, ret... | @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
@param {Uint8Array} bytes
@param {string} metadataList | isURLPotentiallyTrustworthy | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isOriginPotentiallyTrustworthy (origin) {
// If origin is explicitly null, return false
if (origin == null || origin === 'null') return false
const originAsURL = new URL(origin)
// If secure, return true
if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
ret... | @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
@param {Uint8Array} bytes
@param {string} metadataList | isOriginPotentiallyTrustworthy | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function getStrongestMetadata (metadataList) {
// Let algorithm be the algo component of the first item in metadataList.
// Can be sha256
let algorithm = metadataList[0].algo
// If the algorithm is sha512, then it is the strongest
// and we can return immediately
if (algorithm[3] === '5') {
return algor... | @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
@param {URL} A
@param {URL} B | getStrongestMetadata | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function filterMetadataListByAlgorithm (metadataList, algorithm) {
if (metadataList.length === 1) {
return metadataList
}
let pos = 0
for (let i = 0; i < metadataList.length; ++i) {
if (metadataList[i].algo === algorithm) {
metadataList[pos++] = metadataList[i]
}
}
metadataList.length = ... | @see https://fetch.spec.whatwg.org/#concept-method-normalize
@param {string} method | filterMetadataListByAlgorithm | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function compareBase64Mixed (actualValue, expectedValue) {
if (actualValue.length !== expectedValue.length) {
return false
}
for (let i = 0; i < actualValue.length; ++i) {
if (actualValue[i] !== expectedValue[i]) {
if (
(actualValue[i] === '+' && expectedValue[i] === '-') ||
(actualV... | @see https://fetch.spec.whatwg.org/#concept-method-normalize
@param {string} method | compareBase64Mixed | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
// TODO
} | @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
@param {() => unknown[]} iterator
@param {string} name name of the instance
@param {'key'|'value'|'key+value'} kind | tryUpgradeRequestToAPotentiallyTrustworthyURL | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function sameOrigin (A, B) {
// 1. If A and B are the same opaque origin, then return true.
if (A.origin === B.origin && A.origin === 'null') {
return true
}
// 2. If A and B are both tuple origins and their schemes,
// hosts, and port are identical, then return true.
if (A.protocol === B.protocol &... | @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
@param {() => unknown[]} iterator
@param {string} name name of the instance
@param {'key'|'value'|'key+value'} kind | sameOrigin | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function createDeferredPromise () {
let res
let rej
const promise = new Promise((resolve, reject) => {
res = resolve
rej = reject
})
return { promise, resolve: res, reject: rej }
} | @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
@param {() => unknown[]} iterator
@param {string} name name of the instance
@param {'key'|'value'|'key+value'} kind | createDeferredPromise | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isAborted (fetchParams) {
return fetchParams.controller.state === 'aborted'
} | @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
@param {() => unknown[]} iterator
@param {string} name name of the instance
@param {'key'|'value'|'key+value'} kind | isAborted | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isCancelled (fetchParams) {
return fetchParams.controller.state === 'aborted' ||
fetchParams.controller.state === 'terminated'
} | @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
@param {() => unknown[]} iterator
@param {string} name name of the instance
@param {'key'|'value'|'key+value'} kind | isCancelled | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function normalizeMethod (method) {
return normalizeMethodRecord[method.toLowerCase()] ?? method
} | @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
@param {() => unknown[]} iterator
@param {string} name name of the instance
@param {'key'|'value'|'key+value'} kind | normalizeMethod | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isReadableStreamLike (stream) {
if (!ReadableStream) {
ReadableStream = (__nccwpck_require__(3774).ReadableStream)
}
return stream instanceof ReadableStream || (
stream[Symbol.toStringTag] === 'ReadableStream' &&
typeof stream.tee === 'function'
)
} | @see https://fetch.spec.whatwg.org/#is-local
@param {URL} url | isReadableStreamLike | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function readableStreamClose (controller) {
try {
controller.close()
} catch (err) {
// TODO: add comment explaining why this error occurs.
if (!err.message.includes('Controller is already closed')) {
throw err
}
}
} | Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0. | readableStreamClose | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function getEncoding (label) {
if (!label) {
return 'failure'
}
// 1. Remove any leading and trailing ASCII whitespace from label.
// 2. If label is an ASCII case-insensitive match for any of the
// labels listed in the table below, then return the
// corresponding encoding; otherwise return fail... | @see https://encoding.spec.whatwg.org/#concept-encoding-get
@param {string|undefined} label | getEncoding | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor () {
super()
this[kState] = 'empty'
this[kResult] = null
this[kError] = null
this[kEvents] = {
loadend: null,
error: null,
abort: null,
load: null,
progress: null,
loadstart: null
}
} | @see https://w3c.github.io/FileAPI/#dfn-abort | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
readAsArrayBuffer (blob) {
webidl.brandCheck(this, FileReader)
webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
blob = webidl.converters.Blob(blob, { strict: false })
// The readAsArrayBuffer(blob) method, when invoked,
// must initiate a read operation for blo... | @see https://w3c.github.io/FileAPI/#dfn-abort | readAsArrayBuffer | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
readAsBinaryString (blob) {
webidl.brandCheck(this, FileReader)
webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
blob = webidl.converters.Blob(blob, { strict: false })
// The readAsBinaryString(blob) method, when invoked,
// must initiate a read operation for ... | @see https://w3c.github.io/FileAPI/#dom-filereader-readystate | readAsBinaryString | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
readAsText (blob, encoding = undefined) {
webidl.brandCheck(this, FileReader)
webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
blob = webidl.converters.Blob(blob, { strict: false })
if (encoding !== undefined) {
encoding = webidl.converters.DOMString(encoding)
}... | @see https://w3c.github.io/FileAPI/#dom-filereader-error | readAsText | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
readAsDataURL (blob) {
webidl.brandCheck(this, FileReader)
webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
blob = webidl.converters.Blob(blob, { strict: false })
// The readAsDataURL(blob) method, when invoked, must
// initiate a read operation for blob with DataU... | @see https://w3c.github.io/FileAPI/#dom-filereader-error | readAsDataURL | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
abort () {
// 1. If this's state is "empty" or if this's state is
// "done" set this's result to null and terminate
// this algorithm.
if (this[kState] === 'empty' || this[kState] === 'done') {
this[kResult] = null
return
}
// 2. If this's state is "loading" set this's state t... | @see https://w3c.github.io/FileAPI/#dom-filereader-error | abort | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get readyState () {
webidl.brandCheck(this, FileReader)
switch (this[kState]) {
case 'empty': return this.EMPTY
case 'loading': return this.LOADING
case 'done': return this.DONE
}
} | @see https://w3c.github.io/FileAPI/#dom-filereader-error | readyState | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get onloadend () {
webidl.brandCheck(this, FileReader)
return this[kEvents].loadend
} | @see https://w3c.github.io/FileAPI/#dom-filereader-error | onloadend | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set onloadend (fn) {
webidl.brandCheck(this, FileReader)
if (this[kEvents].loadend) {
this.removeEventListener('loadend', this[kEvents].loadend)
}
if (typeof fn === 'function') {
this[kEvents].loadend = fn
this.addEventListener('loadend', fn)
} else {
this[kEvents].loadend ... | @see https://w3c.github.io/FileAPI/#dom-filereader-error | onloadend | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get onerror () {
webidl.brandCheck(this, FileReader)
return this[kEvents].error
} | @see https://w3c.github.io/FileAPI/#dom-filereader-error | onerror | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set onerror (fn) {
webidl.brandCheck(this, FileReader)
if (this[kEvents].error) {
this.removeEventListener('error', this[kEvents].error)
}
if (typeof fn === 'function') {
this[kEvents].error = fn
this.addEventListener('error', fn)
} else {
this[kEvents].error = null
}
... | @see https://w3c.github.io/FileAPI/#dom-filereader-error | onerror | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get onloadstart () {
webidl.brandCheck(this, FileReader)
return this[kEvents].loadstart
} | @see https://w3c.github.io/FileAPI/#dom-filereader-error | onloadstart | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set onloadstart (fn) {
webidl.brandCheck(this, FileReader)
if (this[kEvents].loadstart) {
this.removeEventListener('loadstart', this[kEvents].loadstart)
}
if (typeof fn === 'function') {
this[kEvents].loadstart = fn
this.addEventListener('loadstart', fn)
} else {
this[kEven... | @see https://w3c.github.io/FileAPI/#dom-filereader-error | onloadstart | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set onprogress (fn) {
webidl.brandCheck(this, FileReader)
if (this[kEvents].progress) {
this.removeEventListener('progress', this[kEvents].progress)
}
if (typeof fn === 'function') {
this[kEvents].progress = fn
this.addEventListener('progress', fn)
} else {
this[kEvents].pr... | @see https://xhr.spec.whatwg.org/#progressevent | onprogress | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get onload () {
webidl.brandCheck(this, FileReader)
return this[kEvents].load
} | @see https://xhr.spec.whatwg.org/#progressevent | onload | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set onload (fn) {
webidl.brandCheck(this, FileReader)
if (this[kEvents].load) {
this.removeEventListener('load', this[kEvents].load)
}
if (typeof fn === 'function') {
this[kEvents].load = fn
this.addEventListener('load', fn)
} else {
this[kEvents].load = null
}
} | @see https://xhr.spec.whatwg.org/#progressevent | onload | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get onabort () {
webidl.brandCheck(this, FileReader)
return this[kEvents].abort
} | @see https://xhr.spec.whatwg.org/#progressevent | onabort | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set onabort (fn) {
webidl.brandCheck(this, FileReader)
if (this[kEvents].abort) {
this.removeEventListener('abort', this[kEvents].abort)
}
if (typeof fn === 'function') {
this[kEvents].abort = fn
this.addEventListener('abort', fn)
} else {
this[kEvents].abort = null
}
... | @see https://xhr.spec.whatwg.org/#progressevent | onabort | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor (type, eventInitDict = {}) {
type = webidl.converters.DOMString(type)
eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
super(type, eventInitDict)
this[kState] = {
lengthComputable: eventInitDict.lengthComputable,
loaded: eventInitDict.loaded,
total... | @see https://w3c.github.io/FileAPI/#readOperation
@param {import('./filereader').FileReader} fr
@param {import('buffer').Blob} blob
@param {string} type
@param {string?} encodingName | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get lengthComputable () {
webidl.brandCheck(this, ProgressEvent)
return this[kState].lengthComputable
} | @see https://w3c.github.io/FileAPI/#readOperation
@param {import('./filereader').FileReader} fr
@param {import('buffer').Blob} blob
@param {string} type
@param {string?} encodingName | lengthComputable | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function fireAProgressEvent (e, reader) {
// The progress event e does not bubble. e.bubbles must be false
// The progress event e is NOT cancelable. e.cancelable must be false
const event = new ProgressEvent(e, {
bubbles: false,
cancelable: false
})
reader.dispatchEvent(event)
} | @see https://w3c.github.io/FileAPI/#blob-package-data
@param {Uint8Array[]} bytes
@param {string} type
@param {string?} mimeType
@param {string?} encodingName | fireAProgressEvent | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor (origin, opts) {
super(origin, opts)
if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
throw new InvalidArgumentError('Argument opts.agent must implement Agent')
}
this[kMockAgent] = opts.agent
this[kOrigin] = origin
this[kDispatches] = []
this[kCon... | Allow one to define a reply for a set amount of matching requests. | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
persist () {
this[kMockDispatch].persist = true
return this
} | Mock an undici request with a defined reply. | persist | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
times (repeatTimes) {
if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
}
this[kMockDispatch].times = repeatTimes
return this
} | Mock an undici request with a defined reply. | times | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor (opts, mockDispatches) {
if (typeof opts !== 'object') {
throw new InvalidArgumentError('opts must be an object')
}
if (typeof opts.path === 'undefined') {
throw new InvalidArgumentError('opts.path must be defined')
}
if (typeof opts.method === 'undefined') {
opts.metho... | Mock an undici request with a defined reply. | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
const responseData = getResponseData(data)
const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
const t... | Mock an undici request with a defined reply. | createMockScopeDispatchData | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
validateReplyParameters (statusCode, data, responseOptions) {
if (typeof statusCode === 'undefined') {
throw new InvalidArgumentError('statusCode must be defined')
}
if (typeof data === 'undefined') {
throw new InvalidArgumentError('data must be defined')
}
if (typeof responseOptions !==... | Mock an undici request with a defined error. | validateReplyParameters | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
reply (replyData) {
// Values of reply aren't available right now as they
// can only be available when the reply callback is invoked.
if (typeof replyData === 'function') {
// We'll first wrap the provided callback in another function,
// this function will properly resolve the data from the ca... | Set default reply trailers on the interceptor for subsequent replies | reply | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
wrappedDefaultsCallback = (opts) => {
// Our reply options callback contains the parameter for statusCode, data and options.
const resolvedData = replyData(opts)
// Check if it is in the right format
if (typeof resolvedData !== 'object') {
throw new InvalidArgumentError('reply... | Set reply content length header for replies on the interceptor | wrappedDefaultsCallback | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
wrappedDefaultsCallback = (opts) => {
// Our reply options callback contains the parameter for statusCode, data and options.
const resolvedData = replyData(opts)
// Check if it is in the right format
if (typeof resolvedData !== 'object') {
throw new InvalidArgumentError('reply... | Set reply content length header for replies on the interceptor | wrappedDefaultsCallback | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor (origin, opts) {
super(origin, opts)
if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
throw new InvalidArgumentError('Argument opts.agent must implement Agent')
}
this[kMockAgent] = opts.agent
this[kOrigin] = origin
this[kDispatches] = []
this[kCon... | @param {import('../../index').Headers|string[]|Record<string, string>} headers
@param {string} key | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function addMockDispatch (mockDispatches, key, data) {
const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
const replyData = typeof data === 'function' ? { callback: data } : { ...data }
const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }... | Mock dispatch function used to simulate undici dispatches | addMockDispatch | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function deleteMockDispatch (mockDispatches, key) {
const index = mockDispatches.findIndex(dispatch => {
if (!dispatch.consumed) {
return false
}
return matchKey(dispatch, key)
})
if (index !== -1) {
mockDispatches.splice(index, 1)
}
} | Mock dispatch function used to simulate undici dispatches | deleteMockDispatch | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function buildKey (opts) {
const { path, method, body, headers, query } = opts
return {
path,
method,
body,
headers,
query
}
} | Mock dispatch function used to simulate undici dispatches | buildKey | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function generateKeyValues (data) {
return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
...keyValuePairs,
Buffer.from(`${key}`),
Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
], [])
} | Mock dispatch function used to simulate undici dispatches | generateKeyValues | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function getStatusText (statusCode) {
return STATUS_CODES[statusCode] || 'unknown'
} | Mock dispatch function used to simulate undici dispatches | getStatusText | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
async function getResponse (body) {
const buffers = []
for await (const data of body) {
buffers.push(data)
}
return Buffer.concat(buffers).toString('utf8')
} | Mock dispatch function used to simulate undici dispatches | getResponse | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function mockDispatch (opts, handler) {
// Get mock dispatch from built key
const key = buildKey(opts)
const mockDispatch = getMockDispatch(this[kDispatches], key)
mockDispatch.timesInvoked++
// Here's where we resolve a callback if a callback is present for the dispatch data.
if (mockDispatch.data.callba... | Mock dispatch function used to simulate undici dispatches | mockDispatch | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function handleReply (mockDispatches, _data = data) {
// fetch's HeadersList is a 1D string array
const optsHeaders = Array.isArray(opts.headers)
? buildHeadersFromArray(opts.headers)
: opts.headers
const body = typeof _data === 'function'
? _data({ ...opts, headers: optsHeaders })
:... | Mock dispatch function used to simulate undici dispatches | handleReply | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function refreshTimeout () {
if (fastNowTimeout && fastNowTimeout.refresh) {
fastNowTimeout.refresh()
} else {
clearTimeout(fastNowTimeout)
fastNowTimeout = setTimeout(onTimeout, 1e3)
if (fastNowTimeout.unref) {
fastNowTimeout.unref()
}
}
} | @see https://websockets.spec.whatwg.org/#concept-websocket-establish
@param {URL} url
@param {string|string[]} protocols
@param {import('./websocket').WebSocket} ws
@param {(response: any) => void} onEstablish
@param {Partial<import('../../types/websocket').WebSocketInit>} options | refreshTimeout | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor (callback, delay, opaque) {
this.callback = callback
this.delay = delay
this.opaque = opaque
// -2 not in timer list
// -1 in timer list but inactive
// 0 in timer list waiting for time
// > 0 in timer list waiting for time to expire
this.state = -2
this.refresh()
... | @see https://websockets.spec.whatwg.org/#concept-websocket-establish
@param {URL} url
@param {string|string[]} protocols
@param {import('./websocket').WebSocket} ws
@param {(response: any) => void} onEstablish
@param {Partial<import('../../types/websocket').WebSocketInit>} options | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
refresh () {
if (this.state === -2) {
fastTimers.push(this)
if (!fastNowTimeout || fastTimers.length === 1) {
refreshTimeout()
}
}
this.state = 0
} | @see https://websockets.spec.whatwg.org/#concept-websocket-establish
@param {URL} url
@param {string|string[]} protocols
@param {import('./websocket').WebSocket} ws
@param {(response: any) => void} onEstablish
@param {Partial<import('../../types/websocket').WebSocketInit>} options | refresh | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
clear () {
this.state = -1
} | @see https://websockets.spec.whatwg.org/#concept-websocket-establish
@param {URL} url
@param {string|string[]} protocols
@param {import('./websocket').WebSocket} ws
@param {(response: any) => void} onEstablish
@param {Partial<import('../../types/websocket').WebSocketInit>} options | clear | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
setTimeout (callback, delay, opaque) {
return delay < 1e3
? setTimeout(callback, delay, opaque)
: new Timeout(callback, delay, opaque)
} | @see https://websockets.spec.whatwg.org/#concept-websocket-establish
@param {URL} url
@param {string|string[]} protocols
@param {import('./websocket').WebSocket} ws
@param {(response: any) => void} onEstablish
@param {Partial<import('../../types/websocket').WebSocketInit>} options | setTimeout | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
clearTimeout (timeout) {
if (timeout instanceof Timeout) {
timeout.clear()
} else {
clearTimeout(timeout)
}
} | @see https://websockets.spec.whatwg.org/#concept-websocket-establish
@param {URL} url
@param {string|string[]} protocols
@param {import('./websocket').WebSocket} ws
@param {(response: any) => void} onEstablish
@param {Partial<import('../../types/websocket').WebSocketInit>} options | clearTimeout | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function onSocketError (error) {
const { ws } = this
ws[kReadyState] = states.CLOSING
if (channels.socketError.hasSubscribers) {
channels.socketError.publish(error)
}
this.destroy()
} | @see https://html.spec.whatwg.org/multipage/comms.html#messageevent | onSocketError | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor (type, eventInitDict = {}) {
webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
type = webidl.converters.DOMString(type)
eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
super(type, eventInitDict)
this.#eventInit = eventInitDict
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get data () {
webidl.brandCheck(this, MessageEvent)
return this.#eventInit.data
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | data | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get origin () {
webidl.brandCheck(this, MessageEvent)
return this.#eventInit.origin
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | origin | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get lastEventId () {
webidl.brandCheck(this, MessageEvent)
return this.#eventInit.lastEventId
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | lastEventId | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get source () {
webidl.brandCheck(this, MessageEvent)
return this.#eventInit.source
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | source | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get ports () {
webidl.brandCheck(this, MessageEvent)
if (!Object.isFrozen(this.#eventInit.ports)) {
Object.freeze(this.#eventInit.ports)
}
return this.#eventInit.ports
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | ports | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
initMessageEvent (
type,
bubbles = false,
cancelable = false,
data = null,
origin = '',
lastEventId = '',
source = null,
ports = []
) {
webidl.brandCheck(this, MessageEvent)
webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
return new M... | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | initMessageEvent | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor (type, eventInitDict = {}) {
webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
type = webidl.converters.DOMString(type)
eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
super(type, eventInitDict)
this.#eventInit = eventInitDict
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get wasClean () {
webidl.brandCheck(this, CloseEvent)
return this.#eventInit.wasClean
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | wasClean | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get code () {
webidl.brandCheck(this, CloseEvent)
return this.#eventInit.code
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | code | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get reason () {
webidl.brandCheck(this, CloseEvent)
return this.#eventInit.reason
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | reason | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor (type, eventInitDict) {
webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
super(type, eventInitDict)
type = webidl.converters.DOMString(type)
eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
this.#eventInit = eventInitDict
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get message () {
webidl.brandCheck(this, ErrorEvent)
return this.#eventInit.message
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | message | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get filename () {
webidl.brandCheck(this, ErrorEvent)
return this.#eventInit.filename
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | filename | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get lineno () {
webidl.brandCheck(this, ErrorEvent)
return this.#eventInit.lineno
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | lineno | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get colno () {
webidl.brandCheck(this, ErrorEvent)
return this.#eventInit.colno
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | colno | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get error () {
webidl.brandCheck(this, ErrorEvent)
return this.#eventInit.error
} | @see https://websockets.spec.whatwg.org/#the-closeevent-interface | error | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor (data) {
this.frameData = data
this.maskKey = crypto.randomBytes(4)
} | @param {Buffer} chunk
@param {() => void} callback | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
createFrame (opcode) {
const bodyLength = this.frameData?.byteLength ?? 0
/** @type {number} */
let payloadLength = bodyLength // 0-125
let offset = 6
if (bodyLength > maxUnsigned16Bit) {
offset += 8 // payload length is next 8 bytes
payloadLength = 127
} else if (bodyLength > 125)... | @param {Buffer} chunk
@param {() => void} callback | createFrame | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
constructor (ws) {
super()
this.ws = ws
} | 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. | constructor | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
_write (chunk, _, callback) {
this.#buffers.push(chunk)
this.#byteOffset += chunk.length
this.run(callback)
} | 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. | _write | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.