Skip to content

Latest commit

 

History

History
464 lines (330 loc) · 34.4 KB

CHANGELOG.md

File metadata and controls

464 lines (330 loc) · 34.4 KB

Changelog

All notable changes to this project will be documented in this file.

4.0.0 - (2024-05-20)

🚀 Features

  • *: Add custom message options to all shapes, validators and constraints (#231) (44a5cea)
    • 💥 BREAKING CHANGE: Most shapes and validators that were previously getters are now functions to allow for custom options. The following list should show all of the changes, but if we have forgot any and you get an error saying something should be a function where you have provided a constant it is safe to assume you simply need to add () to your code for it to work again.
    • 💥 BREAKING CHANGE: PickDefined utility type has been removed.
    • 💥 BREAKING CHANGE: PickUndefinedMakeOptional utility type has been removed.
    • 💥 BREAKING CHANGE: NonNullObject utility type has been removed.
    • 💥 BREAKING CHANGE: s.any is now s.any() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array(T).lengthEqual is now s.array(T).lengthEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array(T).lengthGreaterThan is now s.array(T).lengthGreaterThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array(T).lengthGreaterThanOrEqual is now s.array(T).lengthGreaterThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array(T).lengthLessThan is now s.array(T).lengthLessThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array(T).lengthLessThanOrEqual is now s.array(T).lengthLessThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array(T).lengthNotEqual is now s.array(T).lengthNotEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array(T).lengthRange is now s.array(T).lengthRange() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array(T).lengthRangeExclusive is now s.array(T).lengthRangeExclusive() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array(T).lengthRangeInclusive is now s.array(T).lengthRangeInclusive() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array(T).unique is now s.array(T).unique() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.array is now s.array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.bigint.divisibleBy is now s.bigint().divisibleBy() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.bigint.equal is now s.bigint().equal() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.bigint.greaterThan is now s.bigint().greaterThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.bigint.greaterThanOrEqual is now s.bigint().greaterThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.bigint.lessThan is now s.bigint().lessThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.bigint.lessThanOrEqual is now s.bigint().lessThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.bigint.notEqual is now s.bigint().notEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.bigint().abs is now s.bigint().abs() to allow for custom options as second argument.
    • 💥 BREAKING CHANGE: s.bigint().negative is now s.bigint().negative() to allow for custom options as second argument.
    • 💥 BREAKING CHANGE: s.bigint().positive is now s.bigint().positive() to allow for custom options as second argument.
    • 💥 BREAKING CHANGE: s.bigint is now s.bigint() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.bigInt64Array is now s.bigInt64Array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.bigUint64Array is now s.bigUint64Array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.boolean.false is now s.boolean().false() to allow for custom options as second argument.
    • 💥 BREAKING CHANGE: s.boolean.true is now s.boolean().true() to allow for custom options as second argument.
    • 💥 BREAKING CHANGE: s.boolean is now s.boolean() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.default(...) now gets a second parameter to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.default(...).default(...) now gets a second parameter to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.date.equal is now s.date().equal() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.date.greaterThan is now s.date().greaterThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.date.greaterThanOrEqual is now s.date().greaterThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.date.invalid is now s.date().invalid() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.date.lessThan is now s.date().lessThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.date.lessThanOrEqual is now s.date().lessThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.date.notEqual is now s.date().notEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.date.valid is now s.date().valid() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.date is now s.date() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.enum(1, 2, 3) is now s.enum([1, 2, 3]) to allow for custom options as second argument.
    • 💥 BREAKING CHANGE: s.float32Array is now s.float32Array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.float64Array is now s.float64Array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.int16Array is now s.int16Array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.int32Array is now s.int32Array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.int8Array is now s.int8Array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.never is now s.never() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.null is now s.null() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.nullable is now s.nullable() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.nullish is now s.nullish() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.nullish is now s.nullish() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.abs is now s.number().abs() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.ceil is now s.number().ceil() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.divisibleBy is now s.number().divisibleBy() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.equal is now s.number().equal() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.finite is now s.number().finite() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.floor is now s.number().floor() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.fround is now s.number().fround() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.greaterThan is now s.number().greaterThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.greaterThanOrEqual is now s.number().greaterThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.int is now s.number().int() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.lessThan is now s.number().lessThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.lessThanOrEqual is now s.number().lessThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.negative is now s.number().negative() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.notEqual is now s.number().notEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.positive is now s.number().positive() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.round is now s.number().round() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.safeInt is now s.number().safeInt() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.sign is now s.number().sign() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number.trunc is now s.number().trunc() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.number is now s.number() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.object.ignore is now s.object().ignore() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.object.partial is now s.object().partial() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.object.passthrough is now s.object().passthrough() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.object.required is now s.object().required() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.object.strict is now s.object().strict() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.optional is now s.optional() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.required(...) now gets a second parameter to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.set is now s.set() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string.date is now s.string().date() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string.email is now s.string().email() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string.ipv4 is now s.string().ipv4() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string.ipv6 is now s.string().ipv6() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string().ip is now s.string().ip() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string().lengthEqual is now s.string().lengthEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string().lengthGreaterThan is now s.string().lengthGreaterThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string().lengthGreaterThanOrEqual is now s.string().lengthGreaterThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string().lengthLessThan is now s.string().lengthLessThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string().lengthLessThanOrEqual is now s.string().lengthLessThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string().lengthNotEqual is now s.string().lengthNotEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string().phone is now s.string().phone() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string().regex is now s.string().regex() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string().url is now s.string().url() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.string is now s.string() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.tuple(1, 2, 3) is now s.tuple([1, 2, 3]) to allow for custom options as second argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).byteLengthEqual is now s.typedArray(T).byteLengthEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).byteLengthGreaterThan is now s.typedArray(T).byteLengthGreaterThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).byteLengthGreaterThanOrEqual is now s.typedArray(T).byteLengthGreaterThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).byteLengthLessThan is now s.typedArray(T).byteLengthLessThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).byteLengthLessThanOrEqual is now s.typedArray(T).byteLengthLessThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).byteLengthNotEqual is now s.typedArray(T).byteLengthNotEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).byteLengthRange is now s.typedArray(T).byteLengthRange() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).byteLengthRangeExclusive is now s.typedArray(T).byteLengthRangeExclusive() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).byteLengthRangeInclusive is now s.typedArray(T).byteLengthRangeInclusive() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).lengthEqual is now s.typedArray(T).lengthEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).lengthGreaterThan is now s.typedArray(T).lengthGreaterThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).lengthGreaterThanOrEqual is now s.typedArray(T).lengthGreaterThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).lengthLessThan is now s.typedArray(T).lengthLessThan() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).lengthLessThanOrEqual is now s.typedArray(T).lengthLessThanOrEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).lengthNotEqual is now s.typedArray(T).lengthNotEqual() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).lengthRange is now s.typedArray(T).lengthRange() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).lengthRangeExclusive is now s.typedArray(T).lengthRangeExclusive() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.typedArray(T).lengthRangeInclusive is now s.typedArray(T).lengthRangeInclusive() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.uint16Array is now s.uint16Array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.uint32Array is now s.uint32Array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.uint8Array is now s.uint8Array() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.uint8ClampedArray is now s.uint8ClampedArray() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.undefined is now s.undefined() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.union(1, 2, 3).required is now s.union(1, 2, 3).required() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: s.union(1, 2, 3) is now s.union([1, 2, 3]) to allow for custom options as second argument.
    • 💥 BREAKING CHANGE: s.unknown is now s.unknown() to allow for custom options as argument.
    • 💥 BREAKING CHANGE: uniqueArray is now a function (instead of a constant) to allow for custom options as argument.
    • 💥 BREAKING CHANGE: dateInvalid is now a function (instead of a constant) to allow for custom options as argument.
    • 💥 BREAKING CHANGE: dateValid is now a function (instead of a constant) to allow for custom options as argument.
    • 💥 BREAKING CHANGE: numberFinite is now a function (instead of a constant) to allow for custom options as argument.
    • 💥 BREAKING CHANGE: numberInt is now a function (instead of a constant) to allow for custom options as argument.
    • 💥 BREAKING CHANGE: numberNaN is now a function (instead of a constant) to allow for custom options as argument.
    • 💥 BREAKING CHANGE: numberNotNaN is now a function (instead of a constant) to allow for custom options as argument.
    • 💥 BREAKING CHANGE: numberSafeInt is now a function (instead of a constant) to allow for custom options as argument.

3.9.7 - (2024-03-31)

🐛 Bug Fixes

  • Allow engines.node >= 16 (a4d8c8d)

3.9.6 - (2024-01-19)

🐛 Bug Fixes

  • Fixed commonjs typings export mapping (#341) (a5518aa)

3.9.5 - (2023-12-15)

🐛 Bug Fixes

  • Properly publish all dist files (8e925fa)

3.9.4 - (2023-12-04)

🐛 Bug Fixes

  • Properly split CJS and ESM (9bb1ff9)

🧪 Testing

  • Update path to global file (d03b19f)

3.9.3 - (2023-10-13)

🏠 Refactor

  • Change email regex (#306) (c5d49cf)

3.9.2 - (2023-06-04)

🐛 Bug Fixes

  • arrayvalidator: Fixed runaway type instantiation with TypeScript >=5.1 (#275) (f59d901)

3.9.1 - (2023-06-02)

🐛 Bug Fixes

  • types: Move the types condition to the front (#273) (5a3e202)

3.9.0 - (2023-05-09)

🐛 Bug Fixes

  • Resolve minor grammar mistake (#260) (62df609)

🚀 Features

  • Add BaseValidator.describe (#267) (d9e1a2d)

3.8.2 - (2023-04-02)

🐛 Bug Fixes

  • *: TypeScript 5.x compatibility (#253) (eba2a88)
  • Remove node: prefix (#249) (af766b5)

3.8.1 - (2022-12-15)

🐛 Bug Fixes

  • Fixed lodash esm import (#230) (63def7b)

3.8.0 - (2022-12-11)

🏠 Refactor

  • Remove NonNullObject (#227) (04d3934)

🚀 Features

  • Add when constraint (#223) (8eade90)

3.7.1 - (2022-11-27)

🐛 Bug Fixes

  • Fixed "jump to definition" for undefinedToOptional going to wrong symbol (#226) (6aab6d0)

📝 Documentation

  • Add @legendhimslef as a contributor (499522a)

3.7.0 - (2022-10-02)

📝 Documentation

  • Add phone in readme (#203) (4ec9b7a)
  • Add RealShadowNova as a contributor for tool (#185) (6dfc442)

🚀 Features

  • Add s.string.phone (#202) (7d122d5)

3.6.0 - (2022-08-29)

🐛 Bug Fixes

  • Typescript 4.8 compatibility (#179) (2281535)

🚀 Features

  • Add Validator#is (#183) (5114f95)

3.5.1 - (2022-07-17)

🐛 Bug Fixes

  • Fast deep equal import (#155) (5ce8ff6)

3.5.0 - (2022-07-10)

🏠 Refactor

🐛 Bug Fixes

  • Ensure browser compatibility (#150) (92d05d8)
  • Fixed s.array type inference (#153) (a5948dc)
  • Fixed shape#array types (#146) (43016a0)

🚀 Features

3.4.1 - (2022-07-03)

🏠 Refactor

  • Move all type utilities to one file (#139) (61cab3d)

🐛 Bug Fixes

  • Return array-validator from length* methods (#140) (75b1f9a)

🧪 Testing

  • Typechecking for tests (#145) (273cdc8)

3.4.0 - (2022-06-29)

🚀 Features

  • Add required in object validation (#137) (928f7be)

3.3.2 - (2022-06-26)

🐛 Bug Fixes

  • Make keys optional in object parsing (#134) (57a3719)

3.3.1 - (2022-06-22)

🐛 Bug Fixes

  • Add generic type to parse (#133) (90c91aa)

3.3.0 - (2022-06-19)

🐛 Bug Fixes

  • Compile for es2020 instead of es2021 (#128) (051344d)

🚀 Features

  • Allow passing functions in setValidationEnabled (#131) (e1991cf)

🧪 Testing

  • Migrate to vitest (#126) (4d80969)

3.2.0 - (2022-06-11)

🚀 Features

  • Add disabling of validators (#125) (e17af95)

3.1.0 - (2022-06-04)

🐛 Bug Fixes

  • ObjectValidator: Fix #121 (#122) (ecfad7e)

📝 Documentation

  • readme: Clarify the difference between validations and schemas and add table of contents (#108) (dc492a3)

🚀 Features

  • StringValidator: Add date string checks (#106) (1b72907)

3.0.0 - (2022-05-06)

🏃 Performance

  • Speed up object validation a LOT (#101) (817278e)

🐛 Bug Fixes

  • Expand method names (#100) (741490f)}

    💥 Breaking Changes:

    • date.eq has been renamed to date.equal
    • string.lengthLt has been renamed to string.lengthLessThan
    • string.lengthLe has been renamed to string.lengthLessThanOrEqual
    • string.lengthGt has been renamed to string.lengthGreaterThan
    • string.lengthGe has been renamed to string.lengthGreaterThanOrEqual
    • string.lengthEq has been renamed to string.lengthEqual
    • string.lengthNe has been renamed to string.lengthNotEqual
    • number.gt has been renamed to number.greaterThan
    • number.ge has been renamed to number.greaterThanOrEqual
    • number.lt has been renamed to number.lessThan
    • number.le has been renamed to number.lessThanOrEqual
    • number.eq has been renamed to number.equal
    • number.ne has been renamed to number.notEqual
    • bigint.gt has been renamed to bigint.greaterThan
    • bigint.ge has been renamed to bigint.greaterThanOrEqual
    • bigint.lt has been renamed to bigint.lessThan
    • bigint.le has been renamed to bigint.lessThanOrEqual
    • bigint.eq has been renamed to bigint.equal
    • bigint.ne has been renamed to bigint.notEqual
    • boolean.eq has been renamed to boolean.equal
    • boolean.ne has been renamed to boolean.notEqual
    • array.lengthLt has been renamed to array.lengthLessThan
    • array.lengthLe has been renamed to array.lengthLessThanOrEqual
    • array.lengthGt has been renamed to array.lengthGreaterThan
    • array.lengthGe has been renamed to array.lengthGreaterThanOrEqual
    • array.lengthEq has been renamed to array.lengthEqual
    • array.lengthNe has been renamed to array.lengthNotEqual
    • typedArray.lengthLt has been renamed to typedArray.lengthLessThan
    • typedArray.lengthLe has been renamed to typedArray.lengthLessThanOrEqual
    • typedArray.lengthGt has been renamed to typedArray.lengthGreaterThan
    • typedArray.lengthGe has been renamed to typedArray.lengthGreaterThanOrEqual
    • typedArray.lengthEq has been renamed to typedArray.lengthEqual
    • typedArray.lengthNe has been renamed to typedArray.lengthNotEqual
    • typedArray.byteLengthLt has been renamed to typedArray.byteLengthLessThan
    • typedArray.byteLengthLe has been renamed to typedArray.byteLengthLessThanOrEqual
    • typedArray.byteLengthGt has been renamed to typedArray.byteLengthGreaterThan
    • typedArray.byteLengthGe has been renamed to typedArray.byteLengthGreaterThanOrEqual
    • typedArray.byteLengthEq has been renamed to typedArray.byteLengthEqual
    • typedArray.byteLengthNe has been renamed to typedArray.byteLengthNotEqual
  • ObjectValidator: Don't run validation on arrays (#99) (c83b3d0)

🚀 Features

  • Add 2 utility types inspired by yup and co (#102) (2fef902)

2.2.0 - (2022-04-29)

Bug Fixes

  • Ensure BaseError is exported as value (#95) (335d799)

Documentation

  • readme: Add todo notice for reshape and function validations (#75) (d5f16f6)

Features

Performance

  • Optimize NativeEnum (#79) (e9ae280)

Documentation

  • readme: Add todo notice for reshape and function validations (#75) (d5f16f6)

Performance

  • Optimize NativeEnum (#79) (e9ae280)

2.0.0 (2022-03-13)

Features

Bug Fixes

1.0.0 (2022-01-16)

Features

Bug Fixes