Пример
Coerce scalar values to arrays using ajv coerceTypes option
sha256:6c0869519510ebd76ed0393a2bdecf6028623f29ba188f44368ecabd4e7668a9
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Coerce scalar values to arrays using ajv coerceTypes option HOW
- Пакеты
- ajv 8.17.1
- Окружение
- node
- Создан
- 2026-08-16T06:23:00Z
Контракт
- assert coerceTypes: true leaves scalar-to-array uncoerced and fails array validation
- assert coerceTypes: true still coerces scalar-to-scalar fields like string integers
- assert coerceTypes: 'array' coerces scalar string to array of strings and string integer to array of integers
- assert coerceTypes: 'array' coerces single-element array to scalar
- assert coerceTypes: 'array' rejects multi-element array when scalar string is expected
Файлы
- NOTES.md
- csx.json
- package-lock.json
- package.json
- src/index.mjs
- 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