Releases: DWTechs/Checkard.js
Releases · DWTechs/Checkard.js
Better error messages
Type predicate
- All validation functions now accept
unknown
type 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()
,min
andmax
parameters 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
Base64 transform
- Add b64Encode() and b64Decode() methods to transform strings accordingly.