All files / embed-code-core/src int64-utils.ts

100% Statements 6/6
100% Branches 2/2
100% Functions 1/1
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13          5x 5x 5x 15x   5x    
/**
 * Converts Int32Array token IDs to BigInt64Array for ONNX Runtime int64 tensors.
 * Used by both Node.js and Web ONNX backends.
 */
export function int32ToBigInt64(data: Int32Array | number[]): BigInt64Array {
  const arr = data instanceof Int32Array ? new Int32Array(data) : new Int32Array(data);
  const result = new BigInt64Array(arr.length);
  for (let i = 0; i < arr.length; i++) {
    result[i] = BigInt(arr[i]!);
  }
  return result;
}