Releases: DWTechs/Checkard.js
Releases · DWTechs/Checkard.js
Add isAnsiEscapeCode(), isLocale(), isTimeZone() functions
- Add isAnsiEscapeCode() functions to check if a value is a valid ANSI escape code
- Add isLocale() functions to check if a value is a valid locale format
- Add isTimeZone() functions to check if a value is a valid IANA time zone format
- isValidPassword() function is deprecated and will be removed in v4.0.0. Use @dwtechs/passken validation function instead.
Better error messages
- Update error messages
Type predicate
- All validation functions now accept
unknowntype and perform internal type checking - All validation functions now return a type predicate (e.g.,
v is string) instead of a boolean. Except forisFalsy()andisTruthy()still return boolean values. - All contain functions remain unchanged and continue to return boolean values.
- All normalize functions remain unchanged and continue to return string | false
- For both
isValidDate()andisValidTimestamp(),minandmaxparameters can be of type date or timestamp. - Improved
isDate()function to return false when date = date.setDate(NaN) - Improved
isEmail()function to return false when Top-Level Domain starts with a number - Improved
isValidTimestamp()function to have better min and max conversions - Improved test suite to more than 3200 tests with enhanced accuracy and edge case coverage
Improve throwError for compare function
- compare() function now throws an error when a comparison fails and throwError is true, for both unary and binary comparators
throwErr
Delete b64Encode() and b64Decode()
- Delete b64Encode() and b64Decode() functions
String, number and validNumber support for undefined and null in Typescript
- String, number and validNumber functions support undefined and null values in Typescript
Better isProperty() typings
- Update isProperty() function inputs typings
number functions handles string as input
- Update number validation functions type for string as input
string functions empty string cases
- Update string validation functions for empty string cases