```ts
export function addOne(tally: Record<string, number>, name: string, amount: number): Record<string, number> {
  if (typeof name !== 'string' || typeof amount !== 'number') {
    throw new Error('Names and amounts must be strings and numbers, respectively.');
  }
  tally[name] = (tally[name] || 0) + amount;
  return tally;
}

export function mergeTally(left: Record<string, number>, right: Record<string, number>): Record<string, number> {
  if (typeof left !== 'object' || typeof right !== 'object') {
    throw new Error('Both inputs must be objects.');
  }
  for (const name in right) {
    if (right.hasOwnProperty(name)) {
      left[name] = (left[name] || 0) + right[name];
    }
  }
  return left;
}
```