(value: Value)
| 1662 | * @since 3.10.0 |
| 1663 | */ |
| 1664 | export function NonEmptyArrayEnsure<Value extends Schema.Any>(value: Value): NonEmptyArrayEnsure<Value> { |
| 1665 | return transform(Union(value, NonEmptyArray(value)), NonEmptyArray(typeSchema(asSchema(value))), { |
| 1666 | strict: true, |
| 1667 | decode: (i) => array_.isNonEmptyReadonlyArray(i) ? i : array_.of(i), |
| 1668 | encode: (a) => a.length === 1 ? a[0] : a |
| 1669 | }) |
| 1670 | } |
| 1671 | |
| 1672 | /** |
| 1673 | * @since 3.10.0 |
nothing calls this directly
no test coverage detected
searching dependent graphs…