{"id":"62a7b84f670e313f","repo":"sindresorhus/is","slug":"expected-value-which-is-biguint64array-received","errorCode":null,"errorMessage":"Expected value which is `BigUint64Array`, received value of type `${is(value)}`.","messagePattern":"Expected value which is `BigUint64Array`, received value of type `(.+?)`\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"source/index.ts","lineNumber":1498,"sourceCode":"\t\tthrow new TypeError(message ?? typeErrorMessage('AsyncIterable', value));\n\t}\n}\n\nexport function assertBigint(value: unknown, message?: string): asserts value is bigint {\n\tif (!isBigint(value)) {\n\t\tthrow new TypeError(message ?? typeErrorMessage('bigint', value));\n\t}\n}\n\nexport function assertBigInt64Array(value: unknown, message?: string): asserts value is BigInt64Array {\n\tif (!isBigInt64Array(value)) {\n\t\tthrow new TypeError(message ?? typeErrorMessage('BigInt64Array', value));\n\t}\n}\n\nexport function assertBigUint64Array(value: unknown, message?: string): asserts value is BigUint64Array {\n\tif (!isBigUint64Array(value)) {\n\t\tthrow new TypeError(message ?? typeErrorMessage('BigUint64Array', value));\n\t}\n}\n\nexport function assertBlob(value: unknown, message?: string): asserts value is Blob {\n\tif (!isBlob(value)) {\n\t\tthrow new TypeError(message ?? typeErrorMessage('Blob', value));\n\t}\n}\n\nexport function assertBoolean(value: unknown, message?: string): asserts value is boolean {\n\tif (!isBoolean(value)) {\n\t\tthrow new TypeError(message ?? typeErrorMessage('boolean', value));\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport function assertBoundFunction(value: unknown, message?: string): asserts value is Function {\n\tif (!isBoundFunction(value)) {","sourceCodeStart":1480,"sourceCodeEnd":1516,"githubUrl":"https://github.com/sindresorhus/is/blob/7821031c66cdeb7256a0feb2d506535f9e84fcaf/source/index.ts#L1480-L1516","documentation":"Thrown by `assertBigUint64Array()` in the @sindresorhus/is library when the checked value fails the `isBigUint64Array` predicate (getObjectType === 'BigUint64Array'). The assertion exists so downstream code can safely treat the value as a BigUint64Array; the message interpolates the value's detected type via `is(value)` to aid debugging.","triggerScenarios":"Calling `assert.bigUint64Array(value)` / `assertBigUint64Array(value)` with anything that is not a real BigUint64Array: a BigInt64Array, a plain Array of bigints, an ArrayBuffer, a Uint8Array, or a typed array from another realm serialized to JSON.","commonSituations":"Confusing the signed BigInt64Array with the unsigned BigUint64Array; passing raw ArrayBuffers from WebSocket/fetch binary payloads without wrapping; deserializing structured data (JSON turns typed arrays into plain objects/arrays); Node Buffer passed where a 64-bit view was expected.","solutions":["Verify the producer actually creates a `BigUint64Array` — check whether you meant `assert.bigInt64Array` for signed data.","Wrap raw buffers before asserting: `new BigUint64Array(arrayBuffer)`.","If the value crossed a serialization boundary (JSON, postMessage without transfer), reconstruct the typed array from the raw numbers/bigints.","Log `is(value)` output to see the actual detected type and fix the call site."],"exampleFix":"// before\nassert.bigUint64Array(dataFromJson);\n// after\nassert.bigUint64Array(new BigUint64Array(dataFromJson.map(BigInt)));","handlingStrategy":"type-guard","validationCode":"if (!(value instanceof BigUint64Array)) {\n  // convert or reject before calling the API\n}","typeGuard":"function isBigUint64Array(value: unknown): value is BigUint64Array {\n  return value instanceof BigUint64Array;\n}","tryCatchPattern":"try {\n  assert.bigUint64Array(value);\n} catch (error) {\n  if (error instanceof TypeError) {\n    // received a different typed array or plain array — convert explicitly\n  } else throw error;\n}","preventionTips":["Don't confuse BigUint64Array with BigInt64Array or Uint32Array — check the exact constructor","When data crosses a realm boundary (iframe, worker, vm), instanceof may fail; normalize with new BigUint64Array(buffer) first","Construct typed arrays explicitly from ArrayBuffer instead of passing raw buffers or plain arrays"],"tags":["type-assertion","typed-array","bigint","runtime-validation"],"analyzedSha":"7821031c66cdeb7256a0feb2d506535f9e84fcaf","analyzedAt":"2026-07-31T18:34:06.268Z","schemaVersion":2}