```typescript
export function shortUnit(unit: string): string {
  return unit.slice(0, 3);
}

/** An amount written with its unit. */
export function labelOf(amount: number, unit: string): string {
  if (amount < 0) {
    throw new Error("amount cannot be negative");
  }
  const singularUnit = unit === "m" ? "meter" : unit.slice(0, -1);
  return String(amount) + " " + singularUnit + (amount === 1 ? "" : "s");
}
```