Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(*)!: add custom message options to all shapes, validators and constraints #231

Merged
merged 18 commits into from
May 20, 2024

Conversation

favna
Copy link
Member

@favna favna commented Dec 17, 2022

Important

This is a very very breaking change. A document to upgrade from v3 to v4 has been provided. For review a thorough analysis is required to verify that the custom message is available everywhere.

Old content

Warning
WIP WIP WIP! This is far from done. The draft PR is opened so people can become aware the change is incoming.

Breaking changes are tracked in BREAKING_CHANGES.md until the PR is ready for merging. The file has to be removed prior to merging this PR.

Breaking changes list for merge body:

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.

@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.68%. Comparing base (36bd64b) to head (6e01235).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #231      +/-   ##
==========================================
+ Coverage   96.54%   99.68%   +3.14%     
==========================================
  Files          61       59       -2     
  Lines        3592     3870     +278     
  Branches      375      801     +426     
==========================================
+ Hits         3468     3858     +390     
+ Misses        116        4     -112     
  Partials        8        8              
Flag Coverage Δ
18 99.68% <100.00%> (+3.14%) ⬆️
19 99.68% <100.00%> (+3.14%) ⬆️
20 99.68% <100.00%> (+3.14%) ⬆️
21 99.68% <100.00%> (+3.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@favna favna force-pushed the feat/custom-error-messages branch 2 times, most recently from b10b28f to f3488bf Compare January 17, 2023 10:28
BREAKING_CHANGES.md Outdated Show resolved Hide resolved
src/lib/Shapes.ts Show resolved Hide resolved
@favna favna force-pushed the feat/custom-error-messages branch 4 times, most recently from c6c7d8f to 4841101 Compare April 10, 2023 15:16
@favna favna force-pushed the feat/custom-error-messages branch from 3596183 to 572ea9b Compare August 31, 2023 09:14
@favna favna force-pushed the feat/custom-error-messages branch from 64e34ff to ef07dab Compare May 1, 2024 10:56
@favna favna changed the title refactor(*): Add custom message options to all shapes and validators refactor(*): add custom message options to all shapes, validators and constraints May 2, 2024
@favna favna marked this pull request as ready for review May 2, 2024 20:52
@favna favna requested a review from kyranet as a code owner May 2, 2024 20:52
@favna favna removed the help wanted label May 2, 2024
@favna favna force-pushed the feat/custom-error-messages branch 2 times, most recently from 5e07979 to 6e01235 Compare May 9, 2024 13:13
vladfrangu
vladfrangu previously approved these changes May 9, 2024
- ci: add codecov file and update testing config
- refactor: pass options down to all methods and update error names
- ci: fix testing in workflow
- fix: fix tuple shape
- test: update all existing tests to pass again
- test: change magic number for constant
- ci: ensure tests can run in parallel with builds
- ci: change to yarnpkg registry
- ci: fix test parallelization
- test: output coverage as cobertura instead of clover
- chore: create patch out of changes for `esbuild-plugins-node-modules-polyfill`
- chore: cleanup package.json
- feat: pass options through to everything
- refactor: use original type location
- fix: add validator options to when
- fix: fixed argument order for cloning union validator
- docs: expand breaking changes list
- refactor: make `BaseValidator.validatorOptions` protected

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: `NonNullObject` utility type has been removed.
BREAKING CHANGE: `PickDefined` utility type has been removed.
BREAKING CHANGE: `PickUndefinedMakeOptional` utility type has been removed.
BREAKING CHANGE: `s.any` is now `s.any()` to allow for custom options as argument.
BREAKING CHANGE: `s.array.unique` is now `s.array.unique()` to allow for custom options as second argument.
BREAKING CHANGE: `s.array` is now `s.array()` 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.date.invalid` is now `s.date().invalid()` to allow for custom options as second argument.
BREAKING CHANGE: `s.date.valid` is now `s.date().valid()` to allow for custom options as second 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.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.int` is now `s.number().int()` 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.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.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` 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.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)` 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.
@favna favna force-pushed the feat/custom-error-messages branch from 6e01235 to e1879be Compare May 20, 2024 14:48
@favna favna changed the title refactor(*): add custom message options to all shapes, validators and constraints feat(*)!: add custom message options to all shapes, validators and constraints May 20, 2024
@favna favna merged commit 44a5cea into main May 20, 2024
9 checks passed
@favna favna deleted the feat/custom-error-messages branch May 20, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants