```ts
export function stampTable(dies: [string, number][]): Map<string, number> {
  const table = new Map<string, number>();
  for (const [fragment, price] of dies) {
    if (typeof fragment !== "string" || fragment.length === 0) {
      throw new Error("a die fragment must be a non-empty string");
    }
    if (!Number.isInteger(price) || price <= 0) {
      throw new Error("a die price must be a positive integer");
    }
    if (table.has(fragment)) {
      throw new Error("die listed twice: " + fragment);
    }
    table.set(fragment, price);
  }
  return table;
}

export function stampCover(label: string, dies: [string, number][]): number {
  if (typeof label !== "string" || label.length === 0) {
    throw new Error("a label must be a non-empty string");
  }

  const diePrices = stampTable(dies);
  let cheapestPrice = Infinity;
  let currentPrice = 0;

  for (let i = 0; i < label.length; i++) {
    const fragment = label[i];
    if (!diePrices.has(fragment)) {
      throw new Error("label cannot be spelled with the given dies");
    }

    currentPrice += diePrices.get(fragment)!;
    cheapestPrice = Math.min(cheapestPrice, currentPrice);
  }

  return cheapestPrice;
}
```