Drop typed array requirement (2nd try)
This commit is contained in:
parent
1616c7b37d
commit
f45a83bf2c
2 changed files with 3 additions and 3 deletions
|
@ -22,7 +22,7 @@ Contains error messages for failed rules.
|
|||
## Functions
|
||||
### *bool* <u>evaluate</u>()
|
||||
Evaluates all set rules and returns `true` if all rules passed, or `false` if at least one failed.
|
||||
### *CoreValidationSingle* <u>matches_type</u>(*Array[Variant.Type]* <u>types</u>)
|
||||
### *CoreValidationSingle* <u>matches_type</u>(*Array* <u>types</u>)
|
||||
Validates if `data` matches some data type. \
|
||||
Applies to all data types (obviously).
|
||||
### *CoreValidationSingle* <u>matches_class</u>(*StringName* <u>class</u>, *bool* <u>exact</u>)
|
||||
|
@ -49,7 +49,7 @@ Applies to **float**.
|
|||
### *CoreValidationSingle* <u>has_values</u>(*Array* <u>values</u>)
|
||||
Checks whenether at least one value matches `data`.
|
||||
Applies to all data types.
|
||||
### *CoreValidationSingle* <u>contains</u>(*Array[String]* <u>values</u>, *int* <u>minimum_matches</u> = *1*)
|
||||
### *CoreValidationSingle* <u>contains</u>(*Array* <u>values</u>, *int* <u>minimum_matches</u> = *1*)
|
||||
Ensures that [param data] contains at least <`minimum_matches`> (or all if set to `-1`) values. \
|
||||
Applies to **String** & **StringName**.
|
||||
### *CoreValidationSingle* <u>matches_regex</u>(*String* <u>regex_string</u>)
|
||||
|
|
|
@ -282,7 +282,7 @@ func has_values(values: Array) -> CoreValidationSingle:
|
|||
|
||||
## Ensures that [param data] contains at least <[code]minimum_matches[/code]> (or all if set to [code]-1[/code]) values.[br]
|
||||
## Applies to [String] & [StringName].
|
||||
func contains(values: Array[String], minimum_matches: int = 1) -> CoreValidationSingle:
|
||||
func contains(values: Array, minimum_matches: int = 1) -> CoreValidationSingle:
|
||||
rules.append({ "type": CoreTypes.ValidationType.HAS_VALUES, "values": values, "minimum_matches": minimum_matches })
|
||||
return self
|
||||
|
||||
|
|
Loading…
Reference in a new issue