{"version":3,"file":"clamp.mjs","names":[],"sources":["../../src/number/clamp.ts"],"sourcesContent":["/**\n * Clamps number within the inclusive lower and upper bounds.\n *\n * @param number - The number to clamp\n * @param lower - The lower bound\n * @param upper - The upper bound\n * @returns Returns the clamped number\n *\n * @example\n * clamp(10, 5, 15) // => 10\n * clamp(3, 5, 15) // => 5\n * clamp(20, 5, 15) // => 15\n */\nexport function clamp(number: number, lower: number, upper: number): number {\n  if (lower > upper) {\n    throw new Error('lower bound must be less than or equal to upper bound');\n  }\n  return Math.max(lower, Math.min(number, upper));\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,MAAM,QAAgB,OAAe,OAAuB;CAC1E,IAAI,QAAQ,OACV,MAAM,IAAI,MAAM,uDAAuD;CAEzE,OAAO,KAAK,IAAI,OAAO,KAAK,IAAI,QAAQ,KAAK,CAAC;AAChD"}