/**
 * Shared generic admin utilities.
 */

/**
 * Coerce a value to an integer with a fallback.
 */
export function coerceInt(value: unknown, fallback: number): number {
  const n =
    typeof value === "number"
      ? value
      : typeof value === "string"
        ? parseInt(value, 10)
        : NaN;
  return Number.isFinite(n) ? n : fallback;
}
