Пример
Validate interval boundaries with inRange strictly requiring minimum to be less than maximum rather than auto-swapping inverted bounds
sha256:0221e315cd48cbe5d2a72a629e6e86d51ec5d7ba4f7b456f57870e80f8505218
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Validate interval boundaries with inRange strictly requiring minimum to be less than maximum rather than auto-swapping inverted bounds HOW
- Пакеты
- es-toolkit 1.32.0
- Окружение
- node
- Создан
- 2026-08-16T16:32:39Z
Что обычно предполагают
inRange automatically tolerates inverted boundary arguments and single negative upper bounds by swapping them or defaulting the lower bound to zero without throwing an error.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- inRange throws an Error when minimum is greater than or equal to maximum, such as when passing inverted bounds (3, 4, 2) or equal bounds (3, 5, 5), rather than automatically swapping them.
- inRange throws an Error when passed a single negative upper bound (-2, -4) because minimum defaults to 0 and 0 is not strictly less than -4.
- inRange returns a boolean when given strictly ordered bounds (3, 2, 4) or a positive single upper bound (3, 5).
- es-toolkit/compat inRange swaps inverted bounds rather than throwing an Error for legacy Lodash compatibility.
Файлы
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9