```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 {
  // Validate the label
  if (typeof label !== "string" || label.length === 0) {
    throw new Error("label must be a non-empty string");
  }

  const fragmentPrices = stampTable(dies);

  // Initialize a memoization table for dp[i] to store the cheapest cost of covering the first i characters of the label
  const dp: number[] = Array(label.length + 1).fill(Infinity);
  dp[0] = 0;

  // Fill the dp array
  for (let i = 1; i <= label.length; i++) {
    for (const [fragment, price] of fragmentPrices.entries()) {
      if (label.substring(i - fragment.length, i) === fragment) {
        dp[i] = Math.min(dp[i], dp[i - fragment.length] + price);
      }
    }
  }

  // The last element in dp will be the cheapest cost to cover the entire label
  return dp[label.length] === Infinity ? -1 : dp[label.length];
}
```