Skip to content

Releases: DWTechs/Checkard.js

Add isAnsiEscapeCode(), isLocale(), isTimeZone() functions

14 Oct 18:17

Choose a tag to compare

  • 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

07 Sep 09:44

Choose a tag to compare

  • Update error messages

Type predicate

02 Sep 19:00

Choose a tag to compare

  • 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 for isFalsy() and isTruthy() 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() and isValidTimestamp(), min and max 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

24 Aug 05:38

Choose a tag to compare

  • compare() function now throws an error when a comparison fails and throwError is true, for both unary and binary comparators

throwErr

22 Aug 19:41
d15d494

Choose a tag to compare

  • Functions have a throwErr property to throw specific error instead of false
  • isBase64 regex now rejects empty strings, improving validation and error handling

Delete b64Encode() and b64Decode()

19 Aug 18:43

Choose a tag to compare

  • Delete b64Encode() and b64Decode() functions

String, number and validNumber support for undefined and null in Typescript

04 Mar 12:14

Choose a tag to compare

  • String, number and validNumber functions support undefined and null values in Typescript

Better isProperty() typings

23 Feb 20:44

Choose a tag to compare

  • Update isProperty() function inputs typings

number functions handles string as input

23 Feb 16:16

Choose a tag to compare

  • Update number validation functions type for string as input

string functions empty string cases

23 Feb 11:31

Choose a tag to compare

  • Update string validation functions for empty string cases