Added
- feat: Rule 'date_iso' - Validates that a provided value is a date string in the iso format of
YYYY-MM-DDTHH:mm:ss.SSSZ
const v = new Validator({created: 'date_iso'});
v.check({a: '2024-04-31T09:20:00.000Z'}); // false there is no 31st day in April
v.check({a: '2024-04-16T09:20:00.000Z'}); // true
- feat: Rule 'date_day' - Validates that a provided value is a date string in the format of
YYYY-MM-DD
const v = new Validator({created: 'date_day'});
v.check({a: '2023-02-29'}); // false 2023 was not a leap year
v.check({a: '2024-02-29'}); // true
Improved
- perf: ~2-5% improvement in
url_med validation thanks to precompiled regexes
- perf: ~2-5% improvement in
url_vid validation thanks to precompiled regexes
- perf: ~2-5% improvement in
url_aud validation thanks to precompiled regexes
- perf: ~2-5% improvement in
url_img validation thanks to precompiled regexes
- perf: ~2-5% improvement in
sys_ipv4_or_v6 validation thanks to removal of redundant typeof check and simplification of ops
- perf: ~5% improvement in
lt, less_than, lte, less_than_or_equal, gt, greater_than, gte, greater_than_or_equal, between, between_inc when using numerical checks thanks to removal of typeof check and simplification of operations
- sys: Automated test runs are now run against node 18.x, 20.x and 22.x instead of only 20.x
- deps: Upgrade @valkyriestudios/utils to 12.20.0
- deps: Upgrade @types/node to 20.16.0