-
-
Notifications
You must be signed in to change notification settings - Fork 88
Closed
Labels
featureNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
This rule can be quite useful when a future schema validation rule will be added to enforce.
The general idea is quite similar to the enforce.any rule:
enforce(value).isArrayOf(
enforce.isString(),
enforce.isNumber(),
enforce.isArrayOf(...) // Yeah, why not? A recursive call should be pretty simple here
)
The idea is that at least one needs to be truthy in order for the condition to be met - alternatively, an empty array should probably be valid as well unless explicitly mentioned:
enforce(value).isArrayOf(
enforce.isString()
).isNotEmpty()
See Shape for reference.
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers