{"id":"baf356f070fe5121","repo":"sindresorhus/is","slug":"expected-value-which-is-float64array-received-v","errorCode":null,"errorMessage":"Expected value which is `Float64Array`, received value of type `${is(value)}`.","messagePattern":"Expected value which is `Float64Array`, received value of type `(.+?)`\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"source/index.ts","lineNumber":1628,"sourceCode":"\t\tthrow new TypeError(message ?? typeErrorMessage('falsy', value));\n\t}\n}\n\nexport function assertFiniteNumber(value: unknown, message?: string): asserts value is number {\n\tif (!isFiniteNumber(value)) {\n\t\tthrow new TypeError(message ?? typeErrorMessage('finite number', value));\n\t}\n}\n\nexport function assertFloat32Array(value: unknown, message?: string): asserts value is Float32Array {\n\tif (!isFloat32Array(value)) {\n\t\tthrow new TypeError(message ?? typeErrorMessage('Float32Array', value));\n\t}\n}\n\nexport function assertFloat64Array(value: unknown, message?: string): asserts value is Float64Array {\n\tif (!isFloat64Array(value)) {\n\t\tthrow new TypeError(message ?? typeErrorMessage('Float64Array', value));\n\t}\n}\n\nexport function assertFormData(value: unknown, message?: string): asserts value is FormData {\n\tif (!isFormData(value)) {\n\t\tthrow new TypeError(message ?? typeErrorMessage('FormData', value));\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport function assertFunction(value: unknown, message?: string): asserts value is Function {\n\tif (!isFunction(value)) {\n\t\tthrow new TypeError(message ?? typeErrorMessage('Function', value));\n\t}\n}\n\nexport function assertGenerator(value: unknown, message?: string): asserts value is Generator {\n\tif (!isGenerator(value)) {","sourceCodeStart":1610,"sourceCodeEnd":1646,"githubUrl":"https://github.com/sindresorhus/is/blob/7821031c66cdeb7256a0feb2d506535f9e84fcaf/source/index.ts#L1610-L1646","documentation":"Thrown by `assertFloat64Array()` when `isFloat64Array()` returns false. The library uses exact object-tag checks, so only genuine Float64Array instances pass; the TypeError message reports the actual detected type to aid debugging.","triggerScenarios":"`is.assert.float64Array(value)` called with a Float32Array, plain array, ArrayBuffer, Node Buffer, or any non-Float64Array value.","commonSituations":"Numeric/scientific code mixing 32-bit and 64-bit arrays (e.g. a library returns Float32Array for memory savings while your code asserts Float64Array); deserialized data arriving as plain arrays; WASM heap views of the wrong element type.","solutions":["Wrap or convert: `Float64Array.from(values)` or `new Float64Array(buffer)`.","Trace the producer of the value — if it intentionally emits Float32Array, either convert or relax the assertion to match.","Use `is(value)` yourself to see what type is actually flowing through before choosing the fix."],"exampleFix":"// before\nassertFloat64Array(samples); // samples is Float32Array\n// after\nconst samples64 = Float64Array.from(samples);\nassertFloat64Array(samples64);","handlingStrategy":"type-guard","validationCode":"if (!(value instanceof Float64Array)) {\n  throw new TypeError(`Expected Float64Array, got ${typeof value}`);\n}","typeGuard":"function isFloat64Array(value: unknown): value is Float64Array {\n  return value instanceof Float64Array;\n}","tryCatchPattern":"try {\n  assert.float64Array(value);\n} catch (error) {\n  if (error instanceof TypeError) { /* handle wrong typed-array kind */ }\n  else throw error;\n}","preventionTips":["Convert numeric arrays explicitly with `Float64Array.from(arr)` before passing","Verify the buffer view kind at API boundaries — a DataView or Float32Array over the same buffer is not a Float64Array","Type function signatures as `Float64Array`, not `ArrayLike<number>`, so the compiler catches mismatches"],"tags":["typescript","type-assertion","typed-array","runtime-validation"],"analyzedSha":"7821031c66cdeb7256a0feb2d506535f9e84fcaf","analyzedAt":"2026-07-31T18:34:06.268Z","schemaVersion":2}