```ts
export function truncatedProduct(left: number[], right: number[], cap: number): number[] {
  if (!Array.isArray(left) || !Array.isArray(right)) {
    throw new Error("Both arguments must be arrays.");
  }
  if (left.length === 0 && right.length === 0) {
    return [];
  }
  if (left[left.length - 1] === 0 || right[right.length - 1] === 0) {
    throw new Error("The final entry of a polynomial cannot be a zero coefficient.");
  }
  if (!Number.isInteger(cap) || cap < 0) {
    throw new Error("Cap must be a whole number of at least zero.");
  }

  const product: number[] = new Array(left.length + right.length - 1).fill(0);

  for (let i = 0; i < left.length; i++) {
    if (!Number.isInteger(left[i])) {
      throw new Error("Coefficients must be whole numbers.");
    }
    for (let j = 0; j < right.length; j++) {
      if (!Number.isInteger(right[j])) {
        throw new Error("Coefficients must be whole numbers.");
      }
      const exponent = i + j;
      if (exponent <= cap) {
        product[exponent] += left[i] * right[j];
      }
    }
  }

  while (product.length > 0 && product[product.length - 1] === 0) {
    product.pop();
  }

  return product;
}
```