@pathmaker-digital/pmd-utilities - v2.2.6
    Preparing search index...

    Function clamp

    • Clamps a value in between a specified minimum and maximum value.

      Parameters

      • value: number

        The value to clamp.

      • min: number = 0

        The minimum allowed value. Defaults to 0.

      • max: number = 100

        The maximum allowed value. Defaults to 100.

      Returns number

      The number clamped between the min and max.

      clamp(100, 0, 50) // 50