(pos, length)
| 152 | } |
| 153 | |
| 154 | function clampPosition(pos, length) { |
| 155 | if (typeof pos !== "number" || Number.isNaN(pos)) return 0; |
| 156 | return Math.max(0, Math.min(pos, Math.max(0, length))); |
| 157 | } |
| 158 | |
| 159 | function normalizeIndex(value) { |
| 160 | if (typeof value === "number" && Number.isFinite(value)) { |
no outgoing calls
no test coverage detected