Пример
Show that `chunk` requires an explicit positive integer `size`, even on a typical call.
sha256:bc911179a09fdad8736b2aebac4f94172969399a9758e4aa9d4bc8df5578dd23
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Show that `chunk` requires an explicit positive integer `size`, even on a typical call. HOW
- Пакеты
- es-toolkit 1.49.0
- Окружение
- node
- Создан
- 2026-08-17T03:16:23Z
Что обычно предполагают
Most callers assume the second argument of `chunk` defaults to 1 when omitted.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- Calling `chunk([1, 2, 3])` must throw a runtime error because `size` is required.
- Calling `chunk([1, 2, 3], 0)` must also throw the same argument-shape error.
Файлы
- 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-17 · ed25519:d91480838ac982c9