docs(api): Optional related documentation #321
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
I wrote the documentation of
optional()
with examples, and since i was confused at first withfallback()
at first, i decided to write the difference between the two, so people won't make the same misconception as me previously. I also included the difference withnullish()
andnullable()
since it's quite similar but with minor differences. Feel free to tell me if anything is wrong or how i can improve it.WARN: see
api/(types)/OptionalSchema
I created a new folder in
src
calleddata
, see the purpose of this belowAdded:
src/data/allSchemas.ts
: an array of strings with all the schemas inside. (['any', 'array', 'bigint', ...]
)api/(types)/OptionalSchema
: OptionalSchema type definition (WARN: i couldn't represent some types, i added two "WARN" comments inside of the file in theexport const properties
Edited:
api/(schemas)/optional
:optional()
explanation, usage & examplesapi/menu.md
: AddedOptionalSchema
in the types section