You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2
Original file line number
Diff line number
Diff line change
@@ -859,6 +859,7 @@ validator.minLength(str, min); // Checks if the string's length is not less than
859
859
validator.maxLength(str, max); // Checks if the string's length is not more than given number.
860
860
validator.matches(str, pattern, modifiers); // Checks if string matches the pattern. Either matches('foo', /foo/i) or matches('foo', 'foo', 'i').
861
861
validator.isMilitaryTime(str); // Checks if the string is a valid representation of military time in the format HH:MM.
862
+
validator.isHash(algorithm: string); // Checks if the string is a hash of type algorithm.
862
863
863
864
// array validation methods
864
865
validator.arrayContains(array, values); // Checks if array contains all values from the given array of values.
@@ -953,6 +954,7 @@ validator.isInstance(value, target); // Checks value is an instance of the targe
953
954
| `@MaxLength(max:number)` | Checks if the string's length is not more than given number. |
954
955
| `@Matches(pattern:RegExp, modifiers?:string)` | Checks if string matches the pattern. Either matches('foo', /foo/i) or matches('foo', 'foo', 'i').
955
956
| `@IsMilitaryTime()` | Checks if the string is a valid representation of military time in the format HH:MM. |
957
+
| `@IsHash(algorithm:string)` | Checkq if the string is a hash of type algorithm. <br/><br/>Algorithm is one of `['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b']` |
956
958
| **Array validation decorators** |
957
959
| `@ArrayContains(values:any[])` | Checks if array contains all values from the given array of values. |
958
960
| `@ArrayNotContains(values:any[])` | Checks if array does not contain any of the given values. |
0 commit comments