From 37ee86093b5b17e2d960fb443a3a13513a245fcc Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Sun, 8 Oct 2023 15:47:57 +0900 Subject: [PATCH 01/13] chore: add eslint-plugin-jsdoc --- library/.eslintrc.cjs | 1 + library/package.json | 1 + pnpm-lock.yaml | 63 ++++++++++++++++++++++++++++++++++++------- 3 files changed, 55 insertions(+), 10 deletions(-) diff --git a/library/.eslintrc.cjs b/library/.eslintrc.cjs index 8aa33a9db..e51c08e84 100644 --- a/library/.eslintrc.cjs +++ b/library/.eslintrc.cjs @@ -4,6 +4,7 @@ module.exports = { extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:jsdoc/recommended-typescript-error' ], parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint', 'import'], diff --git a/library/package.json b/library/package.json index c59938c1a..eefd0b032 100644 --- a/library/package.json +++ b/library/package.json @@ -58,6 +58,7 @@ "@vitest/coverage-v8": "^0.33.0", "eslint": "^8.43.0", "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsdoc": "^46.8.2", "jsdom": "^22.1.0", "tsup": "^7.1.0", "typescript": "^5.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8779f069c..b6ead0934 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,9 @@ importers: eslint-plugin-import: specifier: ^2.28.1 version: 2.28.1(@typescript-eslint/parser@5.60.0)(eslint@8.43.0) + eslint-plugin-jsdoc: + specifier: ^46.8.2 + version: 46.8.2(eslint@8.43.0) jsdom: specifier: ^22.1.0 version: 22.1.0 @@ -295,6 +298,15 @@ packages: node-source-walk: 6.0.2 dev: true + /@es-joy/jsdoccomment@0.40.1: + resolution: {integrity: sha512-YORCdZSusAlBrFpZ77pJjc5r1bQs5caPWtAu+WWmiSo+8XaUzseapVrfAtiRFbQWnrBxxLLEwF6f6ZG/UgCQCg==} + engines: {node: '>=16'} + dependencies: + comment-parser: 1.4.0 + esquery: 1.5.0 + jsdoc-type-pratt-parser: 4.0.0 + dev: true + /@esbuild/android-arm64@0.18.15: resolution: {integrity: sha512-NI/gnWcMl2kXt1HJKOn2H69SYn4YNheKo6NZt1hyfKWdMbaGadxjZIkcj4Gjk/WPxnbFXs9/3HjGHaknCqjrww==} engines: {node: '>=12'} @@ -2950,6 +2962,11 @@ packages: resolution: {integrity: sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==} dev: true + /are-docs-informative@0.0.2: + resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} + engines: {node: '>=14'} + dev: true + /are-we-there-yet@2.0.0: resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} engines: {node: '>=10'} @@ -3979,6 +3996,11 @@ packages: repeat-string: 1.6.1 dev: true + /comment-parser@1.4.0: + resolution: {integrity: sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==} + engines: {node: '>= 12.0.0'} + dev: true + /common-path-prefix@3.0.0: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} dev: true @@ -5003,6 +5025,26 @@ packages: - supports-color dev: true + /eslint-plugin-jsdoc@46.8.2(eslint@8.43.0): + resolution: {integrity: sha512-5TSnD018f3tUJNne4s4gDWQflbsgOycIKEUBoCLn6XtBMgNHxQFmV8vVxUtiPxAQq8lrX85OaSG/2gnctxw9uQ==} + engines: {node: '>=16'} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@es-joy/jsdoccomment': 0.40.1 + are-docs-informative: 0.0.2 + comment-parser: 1.4.0 + debug: 4.3.4(supports-color@9.4.0) + escape-string-regexp: 4.0.0 + eslint: 8.43.0 + esquery: 1.5.0 + is-builtin-module: 3.2.1 + semver: 7.5.4 + spdx-expression-parse: 3.0.1 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-plugin-qwik@1.1.5(eslint@8.45.0): resolution: {integrity: sha512-fTVZ+XAioqgzs1SkwS43mQl2BSNByWfwdlFSsCPzs4BAAxM9Ii8P1qImBYCAeISYf975G/+VFKpxDmP6FdiFtw==} engines: {node: '>=16'} @@ -5640,6 +5682,7 @@ packages: /file-uri-to-path@1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + requiresBuild: true dev: true /filename-reserved-regex@2.0.0: @@ -7410,6 +7453,11 @@ packages: argparse: 2.0.1 dev: true + /jsdoc-type-pratt-parser@4.0.0: + resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} + engines: {node: '>=12.0.0'} + dev: true + /jsdom@22.1.0: resolution: {integrity: sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==} engines: {node: '>=16'} @@ -7500,7 +7548,7 @@ packages: dependencies: jws: 3.2.2 lodash: 4.17.21 - ms: 2.1.2 + ms: 2.1.3 semver: 7.5.4 dev: true @@ -7982,7 +8030,7 @@ packages: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} engines: {node: '>=8'} dependencies: - semver: 6.3.0 + semver: 6.3.1 dev: true /make-error@1.3.6: @@ -8668,7 +8716,7 @@ packages: prop-ini: 0.0.2 rc: 1.2.8 readme-badger: 0.3.0 - semver: 6.3.0 + semver: 6.3.1 smpltmpl: 1.0.2 split-lines: 2.1.0 strip-bom: 4.0.0 @@ -9530,7 +9578,7 @@ packages: got: 9.6.0 registry-auth-token: 4.2.2 registry-url: 5.1.0 - semver: 6.3.0 + semver: 6.3.1 dev: true /package-json@8.1.1: @@ -10749,7 +10797,7 @@ packages: resolution: {integrity: sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==} engines: {node: '>=8'} dependencies: - semver: 6.3.0 + semver: 6.3.1 dev: true /semver-diff@4.0.0: @@ -10768,11 +10816,6 @@ packages: hasBin: true dev: true - /semver@6.3.0: - resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} - hasBin: true - dev: true - /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true From b975461ae2d2f3a4cbb55bf26ebef08d4f6b37f1 Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Sun, 8 Oct 2023 15:50:52 +0900 Subject: [PATCH 02/13] chore: eslint "src/**/*.ts*" --fix --- library/src/comparable.ts | 2 -- library/src/error/ValiError/ValiError.ts | 1 - library/src/error/flatten/flatten.ts | 8 ++++---- library/src/methods/brand/brand.ts | 3 +-- library/src/methods/coerce/coerce.ts | 4 ---- library/src/methods/coerce/coerceAsync.ts | 4 ---- library/src/methods/fallback/fallback.ts | 4 ---- library/src/methods/fallback/fallbackAsync.ts | 4 ---- library/src/methods/getDefault/getDefault.ts | 2 -- library/src/methods/is/is.ts | 2 -- library/src/methods/keyof/keyof.ts | 2 -- library/src/methods/merge/merge.ts | 10 ++++++---- library/src/methods/merge/mergeAsync.ts | 10 ++++++---- library/src/methods/omit/omit.ts | 11 +++++++---- library/src/methods/omit/omitAsync.ts | 11 +++++++---- library/src/methods/parse/parse.ts | 2 -- library/src/methods/parse/parseAsync.ts | 2 -- library/src/methods/partial/partial.ts | 10 ++++++---- library/src/methods/partial/partialAsync.ts | 10 ++++++---- library/src/methods/passthrough/passthrough.ts | 4 ---- .../src/methods/passthrough/passthroughAsync.ts | 4 ---- library/src/methods/pick/pick.ts | 11 +++++++---- library/src/methods/pick/pickAsync.ts | 11 +++++++---- library/src/methods/required/required.ts | 10 ++++++---- library/src/methods/required/requiredAsync.ts | 10 ++++++---- library/src/methods/safeParse/safeParse.ts | 2 -- library/src/methods/safeParse/safeParseAsync.ts | 2 -- library/src/methods/strict/strict.ts | 4 ---- library/src/methods/strict/strictAsync.ts | 4 ---- library/src/methods/strip/strip.ts | 4 ---- library/src/methods/strip/stripAsync.ts | 4 ---- library/src/methods/transform/transform.ts | 4 ---- library/src/methods/transform/transformAsync.ts | 4 ---- library/src/methods/unwrap/unwrap.ts | 2 -- library/src/methods/withDefault/withDefault.ts | 6 ------ library/src/schemas/any/any.ts | 4 ---- library/src/schemas/any/anyAsync.ts | 4 ---- library/src/schemas/array/array.ts | 12 ++++++------ library/src/schemas/array/arrayAsync.ts | 12 ++++++------ library/src/schemas/bigint/bigint.ts | 11 +++++------ library/src/schemas/bigint/bigintAsync.ts | 11 +++++------ library/src/schemas/blob/blob.ts | 11 +++++------ library/src/schemas/blob/blobAsync.ts | 11 +++++------ library/src/schemas/boolean/boolean.ts | 11 +++++------ library/src/schemas/boolean/booleanAsync.ts | 11 +++++------ library/src/schemas/date/date.ts | 11 +++++------ library/src/schemas/date/dateAsync.ts | 11 +++++------ library/src/schemas/enumType/enumType.ts | 4 ---- library/src/schemas/enumType/enumTypeAsync.ts | 4 ---- library/src/schemas/instance/instance.ts | 12 ++++++------ library/src/schemas/instance/instanceAsync.ts | 12 ++++++------ .../src/schemas/intersection/intersection.ts | 4 ---- .../schemas/intersection/intersectionAsync.ts | 4 ---- .../utils/mergeOutputs/mergeOutputs.ts | 2 -- library/src/schemas/literal/literal.ts | 4 ---- library/src/schemas/literal/literalAsync.ts | 4 ---- library/src/schemas/map/map.ts | 13 +++++++------ library/src/schemas/map/mapAsync.ts | 13 +++++++------ library/src/schemas/nan/nan.ts | 4 ---- library/src/schemas/nan/nanAsync.ts | 4 ---- library/src/schemas/nativeEnum/nativeEnum.ts | 4 ---- .../src/schemas/nativeEnum/nativeEnumAsync.ts | 4 ---- library/src/schemas/never/never.ts | 4 ---- library/src/schemas/never/neverAsync.ts | 4 ---- library/src/schemas/nonNullable/nonNullable.ts | 4 ---- .../src/schemas/nonNullable/nonNullableAsync.ts | 4 ---- library/src/schemas/nonNullish/nonNullish.ts | 4 ---- .../src/schemas/nonNullish/nonNullishAsync.ts | 4 ---- library/src/schemas/nonOptional/nonOptional.ts | 4 ---- .../src/schemas/nonOptional/nonOptionalAsync.ts | 4 ---- library/src/schemas/nullType/nullType.ts | 4 ---- library/src/schemas/nullType/nullTypeAsync.ts | 4 ---- library/src/schemas/nullable/nullable.ts | 4 ---- library/src/schemas/nullable/nullableAsync.ts | 4 ---- library/src/schemas/nullish/nullish.ts | 4 ---- library/src/schemas/nullish/nullishAsync.ts | 4 ---- library/src/schemas/number/number.ts | 11 +++++------ library/src/schemas/number/numberAsync.ts | 11 +++++------ library/src/schemas/object/object.ts | 12 ++++++------ library/src/schemas/object/objectAsync.ts | 12 ++++++------ library/src/schemas/optional/optional.ts | 4 ---- library/src/schemas/optional/optionalAsync.ts | 4 ---- library/src/schemas/record/record.ts | 17 +++++++---------- library/src/schemas/record/recordAsync.ts | 17 +++++++---------- .../record/utils/getRecordArgs/getRecordArgs.ts | 2 -- library/src/schemas/recursive/recursive.ts | 4 ---- library/src/schemas/recursive/recursiveAsync.ts | 4 ---- library/src/schemas/set/set.ts | 12 ++++++------ library/src/schemas/set/setAsync.ts | 12 ++++++------ library/src/schemas/special/special.ts | 12 ++++++------ library/src/schemas/special/specialAsync.ts | 12 ++++++------ library/src/schemas/string/string.ts | 11 +++++------ library/src/schemas/string/stringAsync.ts | 11 +++++------ library/src/schemas/symbol/symbol.ts | 4 ---- library/src/schemas/symbol/symbolAsync.ts | 4 ---- library/src/schemas/tuple/tuple.ts | 17 +++++++---------- library/src/schemas/tuple/tupleAsync.ts | 17 +++++++---------- .../tuple/utils/getTupleArgs/getTupleArgs.ts | 2 -- .../src/schemas/undefinedType/undefinedType.ts | 4 ---- .../schemas/undefinedType/undefinedTypeAsync.ts | 4 ---- library/src/schemas/union/union.ts | 4 ---- library/src/schemas/union/unionAsync.ts | 4 ---- library/src/schemas/unknown/unknown.ts | 4 ---- library/src/schemas/unknown/unknownAsync.ts | 4 ---- library/src/schemas/voidType/voidType.ts | 4 ---- library/src/schemas/voidType/voidTypeAsync.ts | 4 ---- .../src/transformations/toCustom/toCustom.ts | 2 -- .../transformations/toCustom/toCustomAsync.ts | 2 -- .../transformations/toLowerCase/toLowerCase.ts | 1 - .../transformations/toMaxValue/toMaxValue.ts | 2 -- .../transformations/toMinValue/toMinValue.ts | 2 -- .../src/transformations/toTrimmed/toTrimmed.ts | 1 - .../toTrimmedEnd/toTrimmedEnd.ts | 1 - .../toTrimmedStart/toTrimmedStart.ts | 1 - .../transformations/toUpperCase/toUpperCase.ts | 1 - library/src/utils/executePipe/executePipe.ts | 4 ++-- .../src/utils/executePipe/executePipeAsync.ts | 4 ++-- .../executePipe/utils/getIssue/getIssue.ts | 2 -- .../utils/getPipeInfo/getPipeInfo.ts | 2 -- .../src/utils/getDefaultArgs/getDefaultArgs.ts | 2 -- .../utils/getErrorMessage/getErrorMessage.ts | 2 -- library/src/utils/getIssues/getIssues.ts | 2 -- library/src/utils/getOutput/getOutput.ts | 2 -- .../src/utils/getPipeIssues/getPipeIssues.ts | 2 -- .../utils/getSchemaIssues/getSchemaIssues.ts | 2 -- library/src/utils/isLuhnAlgo/isLuhnAlgo.ts | 2 -- library/src/validations/bytes/bytes.ts | 2 -- library/src/validations/cuid2/cuid2.ts | 2 -- library/src/validations/custom/custom.ts | 2 -- library/src/validations/custom/customAsync.ts | 2 -- library/src/validations/email/email.ts | 2 -- library/src/validations/emoji/emoji.ts | 2 -- library/src/validations/endsWith/endsWith.ts | 2 -- library/src/validations/equal/equal.ts | 3 --- library/src/validations/excludes/excludes.ts | 2 -- library/src/validations/finite/finite.ts | 2 -- library/src/validations/imei/imei.ts | 2 -- library/src/validations/includes/includes.ts | 2 -- library/src/validations/integer/integer.ts | 2 -- library/src/validations/ip/ip.ts | 2 -- library/src/validations/ipv4/ipv4.ts | 2 -- library/src/validations/ipv6/ipv6.ts | 2 -- library/src/validations/isoDate/isoDate.ts | 2 -- .../src/validations/isoDateTime/isoDateTime.ts | 2 -- library/src/validations/isoTime/isoTime.ts | 2 -- .../validations/isoTimeSecond/isoTimeSecond.ts | 2 -- .../validations/isoTimestamp/isoTimestamp.ts | 2 -- library/src/validations/isoWeek/isoWeek.ts | 2 -- library/src/validations/length/length.ts | 2 -- library/src/validations/maxBytes/maxBytes.ts | 2 -- library/src/validations/maxLength/maxLength.ts | 2 -- library/src/validations/maxSize/maxSize.ts | 2 -- library/src/validations/maxValue/maxValue.ts | 3 --- library/src/validations/mimeType/mimeType.ts | 2 -- library/src/validations/minBytes/minBytes.ts | 2 -- library/src/validations/minLength/minLength.ts | 2 -- library/src/validations/minSize/minSize.ts | 2 -- library/src/validations/minValue/minValue.ts | 3 --- .../src/validations/multipleOf/multipleOf.ts | 2 -- library/src/validations/notBytes/notBytes.ts | 2 -- library/src/validations/notLength/notLength.ts | 2 -- library/src/validations/notSize/notSize.ts | 2 -- library/src/validations/notValue/notValue.ts | 2 -- library/src/validations/regex/regex.ts | 2 -- .../src/validations/safeInteger/safeInteger.ts | 2 -- library/src/validations/size/size.ts | 2 -- .../src/validations/startsWith/startsWith.ts | 2 -- library/src/validations/ulid/ulid.ts | 2 -- library/src/validations/url/url.ts | 2 -- library/src/validations/uuid/uuid.ts | 2 -- library/src/validations/value/value.ts | 2 -- 171 files changed, 235 insertions(+), 597 deletions(-) diff --git a/library/src/comparable.ts b/library/src/comparable.ts index 93b653cea..dd7d8ce6d 100644 --- a/library/src/comparable.ts +++ b/library/src/comparable.ts @@ -2,9 +2,7 @@ import { expect } from 'vitest'; /** * Prepares an object so that it can be compared to another with `.toEqual`. - * * @param value The object to prepare. - * * @returns The comparable object. */ export function comparable(value: any): any { diff --git a/library/src/error/ValiError/ValiError.ts b/library/src/error/ValiError/ValiError.ts index 615294082..cb32defbc 100644 --- a/library/src/error/ValiError/ValiError.ts +++ b/library/src/error/ValiError/ValiError.ts @@ -8,7 +8,6 @@ export class ValiError extends Error { /** * Creates a Valibot error with useful information. - * * @param issues The error issues. */ constructor(issues: Issues) { diff --git a/library/src/error/flatten/flatten.ts b/library/src/error/flatten/flatten.ts index 6ee0e44d3..464551820 100644 --- a/library/src/error/flatten/flatten.ts +++ b/library/src/error/flatten/flatten.ts @@ -125,9 +125,7 @@ export type FlatErrors = { /** * Flatten the error messages of a Vali error. - * * @param error A Vali error. - * * @returns Flat errors. */ export function flatten( @@ -136,15 +134,17 @@ export function flatten( /** * Flatten the error messages of issues. - * * @param issues The issues. - * * @returns Flat errors. */ export function flatten( issues: Issues ): FlatErrors; +/** + * + * @param arg1 + */ export function flatten( arg1: ValiError | Issues ): FlatErrors { diff --git a/library/src/methods/brand/brand.ts b/library/src/methods/brand/brand.ts index 2afe04009..0438d837e 100644 --- a/library/src/methods/brand/brand.ts +++ b/library/src/methods/brand/brand.ts @@ -679,10 +679,9 @@ export function brand< /** * Brands the output type of a schema. - * * @param schema The scheme to be branded. * @param brand The brand name. - * + * @param name * @returns The branded schema. */ export function brand< diff --git a/library/src/methods/coerce/coerce.ts b/library/src/methods/coerce/coerce.ts index c0dce8352..0bd459083 100644 --- a/library/src/methods/coerce/coerce.ts +++ b/library/src/methods/coerce/coerce.ts @@ -2,10 +2,8 @@ import type { BaseSchema, Input } from '../../types.ts'; /** * Coerces the input of a schema to match the required type. - * * @param schema The affected schema. * @param action The coerceation action. - * * @returns The passed schema. */ export function coerce( @@ -17,10 +15,8 @@ export function coerce( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/coerce/coerceAsync.ts b/library/src/methods/coerce/coerceAsync.ts index 63c4d263d..311e768ef 100644 --- a/library/src/methods/coerce/coerceAsync.ts +++ b/library/src/methods/coerce/coerceAsync.ts @@ -2,10 +2,8 @@ import type { BaseSchemaAsync, Input } from '../../types.ts'; /** * Coerces the input of a async schema to match the required type. - * * @param schema The affected schema. * @param action The coerceation action. - * * @returns The passed schema. */ export function coerceAsync( @@ -17,10 +15,8 @@ export function coerceAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/fallback/fallback.ts b/library/src/methods/fallback/fallback.ts index 9963d8122..915946392 100644 --- a/library/src/methods/fallback/fallback.ts +++ b/library/src/methods/fallback/fallback.ts @@ -4,10 +4,8 @@ import type { FallbackInfo } from './types.ts'; /** * Returns a fallback value when validating the passed schema failed. - * * @param schema The schema to catch. * @param value The fallback value. - * * @returns The passed schema. */ export function fallback( @@ -19,10 +17,8 @@ export function fallback( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/fallback/fallbackAsync.ts b/library/src/methods/fallback/fallbackAsync.ts index 26a4a1f04..346920e59 100644 --- a/library/src/methods/fallback/fallbackAsync.ts +++ b/library/src/methods/fallback/fallbackAsync.ts @@ -4,10 +4,8 @@ import type { FallbackInfo } from './types.ts'; /** * Returns a fallback value when validating the passed schema failed. - * * @param schema The schema to catch. * @param value The fallback value. - * * @returns The passed schema. */ export function fallbackAsync( @@ -19,10 +17,8 @@ export function fallbackAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/getDefault/getDefault.ts b/library/src/methods/getDefault/getDefault.ts index c0ca85582..795f2256a 100644 --- a/library/src/methods/getDefault/getDefault.ts +++ b/library/src/methods/getDefault/getDefault.ts @@ -9,9 +9,7 @@ import type { /** * Returns the default value of the schema. - * * @param schema The schema to get the default value from. - * * @returns The default value. */ export function getDefault< diff --git a/library/src/methods/is/is.ts b/library/src/methods/is/is.ts index a7b641d58..6262c4acf 100644 --- a/library/src/methods/is/is.ts +++ b/library/src/methods/is/is.ts @@ -3,10 +3,8 @@ import type { BaseSchema, Input } from '../../types.ts'; /** * Checks if the input matches the scheme. By using a type predicate, this * function can be used as a type guard. - * * @param schema The schema to be used. * @param input The input to be tested. - * * @returns Whether the input matches the scheme. */ export function is( diff --git a/library/src/methods/keyof/keyof.ts b/library/src/methods/keyof/keyof.ts index ac52dd8e9..c5c2467d5 100644 --- a/library/src/methods/keyof/keyof.ts +++ b/library/src/methods/keyof/keyof.ts @@ -30,9 +30,7 @@ type TupleOrNever = T extends [string, ...string[]] ? T : never; /** * Creates a enum schema of object keys. - * * @param schema The object schema. - * * @returns A enum schema. */ export function keyof< diff --git a/library/src/methods/merge/merge.ts b/library/src/methods/merge/merge.ts index 51abcbe9d..5e274c4f9 100644 --- a/library/src/methods/merge/merge.ts +++ b/library/src/methods/merge/merge.ts @@ -19,10 +19,8 @@ type ObjectSchemas = [ /** * Merges multiple object schemas into a single one. Subsequent object schemas * overwrite the previous ones. - * * @param schemas The schemas to be merged. * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function merge( @@ -33,11 +31,9 @@ export function merge( /** * Merges multiple object schemas into a single one. Subsequent object schemas * overwrite the previous ones. - * * @param schemas The schemas to be merged. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function merge( @@ -46,6 +42,12 @@ export function merge( pipe?: Pipe>> ): ObjectSchema>; +/** + * + * @param schemas + * @param arg2 + * @param arg3 + */ export function merge( schemas: TObjectSchemas, arg2?: Pipe>> | ErrorMessage, diff --git a/library/src/methods/merge/mergeAsync.ts b/library/src/methods/merge/mergeAsync.ts index 7076a612e..3446dbe1c 100644 --- a/library/src/methods/merge/mergeAsync.ts +++ b/library/src/methods/merge/mergeAsync.ts @@ -20,10 +20,8 @@ type ObjectSchemas = [ /** * Merges multiple async object schemas into a single one. Subsequent object * schemas overwrite the previous ones. - * * @param schemas The schemas to be merged. * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function mergeAsync( @@ -34,11 +32,9 @@ export function mergeAsync( /** * Merges multiple async object schemas into a single one. Subsequent object * schemas overwrite the previous ones. - * * @param schemas The schemas to be merged. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function mergeAsync( @@ -47,6 +43,12 @@ export function mergeAsync( pipe?: PipeAsync>> ): ObjectSchemaAsync>; +/** + * + * @param schemas + * @param arg2 + * @param arg3 + */ export function mergeAsync( schemas: TObjectSchemas, arg2?: diff --git a/library/src/methods/omit/omit.ts b/library/src/methods/omit/omit.ts index 5970add1e..3b6087286 100644 --- a/library/src/methods/omit/omit.ts +++ b/library/src/methods/omit/omit.ts @@ -10,11 +10,9 @@ import type { ObjectKeys } from './types.ts'; /** * Creates an object schema that contains not the selected keys of an existing * schema. - * * @param schema The schema to omit from. * @param keys The selected keys * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function omit< @@ -29,12 +27,10 @@ export function omit< /** * Creates an object schema that contains not the selected keys of an existing * schema. - * * @param schema The schema to omit from. * @param keys The selected keys * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function omit< @@ -47,6 +43,13 @@ export function omit< pipe?: Pipe>> ): ObjectSchema>; +/** + * + * @param schema + * @param keys + * @param arg3 + * @param arg4 + */ export function omit< TObjectSchema extends ObjectSchema, TKeys extends ObjectKeys diff --git a/library/src/methods/omit/omitAsync.ts b/library/src/methods/omit/omitAsync.ts index 5bca0f7d3..adb8514ed 100644 --- a/library/src/methods/omit/omitAsync.ts +++ b/library/src/methods/omit/omitAsync.ts @@ -11,11 +11,9 @@ import type { ObjectKeys } from './types.ts'; /** * Creates an async object schema that contains only the selected keys of an * existing schema. - * * @param schema The schema to omit from. * @param keys The selected keys * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function omitAsync< @@ -30,12 +28,10 @@ export function omitAsync< /** * Creates an async object schema that contains only the selected keys of an * existing schema. - * * @param schema The schema to omit from. * @param keys The selected keys * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function omitAsync< @@ -48,6 +44,13 @@ export function omitAsync< pipe?: PipeAsync>> ): ObjectSchemaAsync>; +/** + * + * @param schema + * @param keys + * @param arg3 + * @param arg4 + */ export function omitAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends ObjectKeys diff --git a/library/src/methods/parse/parse.ts b/library/src/methods/parse/parse.ts index 56ad81768..cb307ffd4 100644 --- a/library/src/methods/parse/parse.ts +++ b/library/src/methods/parse/parse.ts @@ -3,11 +3,9 @@ import type { BaseSchema, Output, ParseInfo } from '../../types.ts'; /** * Parses unknown input based on a schema. - * * @param schema The schema to be used. * @param input The input to be parsed. * @param info The optional parse info. - * * @returns The parsed output. */ export function parse( diff --git a/library/src/methods/parse/parseAsync.ts b/library/src/methods/parse/parseAsync.ts index a573ade7b..ed24640ed 100644 --- a/library/src/methods/parse/parseAsync.ts +++ b/library/src/methods/parse/parseAsync.ts @@ -8,11 +8,9 @@ import type { /** * Parses unknown input based on a schema. - * * @param schema The schema to be used. * @param input The input to be parsed. * @param info The optional parse info. - * * @returns The parsed output. */ export async function parseAsync( diff --git a/library/src/methods/partial/partial.ts b/library/src/methods/partial/partial.ts index a3b57e3b1..2ef8657bf 100644 --- a/library/src/methods/partial/partial.ts +++ b/library/src/methods/partial/partial.ts @@ -19,10 +19,8 @@ type Partial = { /** * Creates an object schema consisting of all properties of an existing object * schema set to optional. - * * @param schema The affected schema. * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function partial>( @@ -33,11 +31,9 @@ export function partial>( /** * Creates an object schema consisting of all properties of an existing object * schema set to optional. - * * @param schema The affected schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function partial>( @@ -46,6 +42,12 @@ export function partial>( pipe?: Pipe>> ): ObjectSchema>; +/** + * + * @param schema + * @param arg3 + * @param arg4 + */ export function partial>( schema: TObjectSchema, arg3?: Pipe>> | ErrorMessage, diff --git a/library/src/methods/partial/partialAsync.ts b/library/src/methods/partial/partialAsync.ts index 39f532973..f70b8daf7 100644 --- a/library/src/methods/partial/partialAsync.ts +++ b/library/src/methods/partial/partialAsync.ts @@ -20,10 +20,8 @@ type Partial = { /** * Creates an async object schema consisting of all properties of an existing * object schema set to optional. - * * @param schema The affected schema. * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function partialAsync< @@ -36,11 +34,9 @@ export function partialAsync< /** * Creates an async object schema consisting of all properties of an existing * object schema set to optional. - * * @param schema The affected schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function partialAsync< @@ -51,6 +47,12 @@ export function partialAsync< pipe?: PipeAsync>> ): ObjectSchemaAsync>; +/** + * + * @param schema + * @param arg3 + * @param arg4 + */ export function partialAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync >( diff --git a/library/src/methods/passthrough/passthrough.ts b/library/src/methods/passthrough/passthrough.ts index 979d80863..052083c50 100644 --- a/library/src/methods/passthrough/passthrough.ts +++ b/library/src/methods/passthrough/passthrough.ts @@ -3,9 +3,7 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates an object schema that passes unknown keys. - * * @param schema A object schema. - * * @returns A object schema. */ export function passthrough>( @@ -16,10 +14,8 @@ export function passthrough>( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/passthrough/passthroughAsync.ts b/library/src/methods/passthrough/passthroughAsync.ts index b64be54e8..eef9b5482 100644 --- a/library/src/methods/passthrough/passthroughAsync.ts +++ b/library/src/methods/passthrough/passthroughAsync.ts @@ -3,9 +3,7 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates an object schema that passes unknown keys. - * * @param schema A object schema. - * * @returns A object schema. */ export function passthroughAsync>( @@ -16,10 +14,8 @@ export function passthroughAsync>( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/pick/pick.ts b/library/src/methods/pick/pick.ts index a2724f9e8..3467a0a71 100644 --- a/library/src/methods/pick/pick.ts +++ b/library/src/methods/pick/pick.ts @@ -9,11 +9,9 @@ import { getDefaultArgs } from '../../utils/index.ts'; /** * Creates an object schema that contains only the selected keys of an existing * schema. - * * @param schema The schema to pick from. * @param keys The selected keys * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function pick< @@ -28,12 +26,10 @@ export function pick< /** * Creates an object schema that contains only the selected keys of an existing * schema. - * * @param schema The schema to pick from. * @param keys The selected keys * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function pick< @@ -46,6 +42,13 @@ export function pick< pipe?: Pipe>> ): ObjectSchema>; +/** + * + * @param schema + * @param keys + * @param arg3 + * @param arg4 + */ export function pick< TObjectSchema extends ObjectSchema, TKeys extends (keyof TObjectSchema['object'])[] diff --git a/library/src/methods/pick/pickAsync.ts b/library/src/methods/pick/pickAsync.ts index d0e9da1b3..e89a485c2 100644 --- a/library/src/methods/pick/pickAsync.ts +++ b/library/src/methods/pick/pickAsync.ts @@ -10,11 +10,9 @@ import { getDefaultArgs } from '../../utils/index.ts'; /** * Creates an async object schema that contains only the selected keys of an * existing schema. - * * @param schema The schema to pick from. * @param keys The selected keys * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function pickAsync< @@ -29,12 +27,10 @@ export function pickAsync< /** * Creates an async object schema that contains only the selected keys of an * existing schema. - * * @param schema The schema to pick from. * @param keys The selected keys * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function pickAsync< @@ -47,6 +43,13 @@ export function pickAsync< pipe?: PipeAsync>> ): ObjectSchemaAsync>; +/** + * + * @param schema + * @param keys + * @param arg3 + * @param arg4 + */ export function pickAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends (keyof TObjectSchema['object'])[] diff --git a/library/src/methods/required/required.ts b/library/src/methods/required/required.ts index b5edcad70..4e90838c5 100644 --- a/library/src/methods/required/required.ts +++ b/library/src/methods/required/required.ts @@ -19,10 +19,8 @@ type Required = { /** * Creates an object schema consisting of all properties of an existing object * schema set to none optional. - * * @param schema The affected schema. * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function required>( @@ -33,11 +31,9 @@ export function required>( /** * Creates an object schema consisting of all properties of an existing object * schema set to none optional. - * * @param schema The affected schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function required>( @@ -46,6 +42,12 @@ export function required>( pipe?: Pipe>> ): ObjectSchema>; +/** + * + * @param schema + * @param arg3 + * @param arg4 + */ export function required>( schema: TObjectSchema, arg3?: Pipe>> | ErrorMessage, diff --git a/library/src/methods/required/requiredAsync.ts b/library/src/methods/required/requiredAsync.ts index 0a5012c7c..673d0e390 100644 --- a/library/src/methods/required/requiredAsync.ts +++ b/library/src/methods/required/requiredAsync.ts @@ -20,10 +20,8 @@ type Required = { /** * Creates an async object schema consisting of all properties of an existing * object schema set to none optional. - * * @param schema The affected schema. * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function requiredAsync< @@ -36,11 +34,9 @@ export function requiredAsync< /** * Creates an async object schema consisting of all properties of an existing * object schema set to none optional. - * * @param schema The affected schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function requiredAsync< @@ -51,6 +47,12 @@ export function requiredAsync< pipe?: PipeAsync>> ): ObjectSchemaAsync>; +/** + * + * @param schema + * @param arg3 + * @param arg4 + */ export function requiredAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync >( diff --git a/library/src/methods/safeParse/safeParse.ts b/library/src/methods/safeParse/safeParse.ts index b3d8ce2c8..68f65e0c7 100644 --- a/library/src/methods/safeParse/safeParse.ts +++ b/library/src/methods/safeParse/safeParse.ts @@ -4,11 +4,9 @@ import type { SafeParseResult } from './types.ts'; /** * Parses unknown input based on a schema. - * * @param schema The schema to be used. * @param input The input to be parsed. * @param info The optional parse info. - * * @returns The parsed output. */ export function safeParse( diff --git a/library/src/methods/safeParse/safeParseAsync.ts b/library/src/methods/safeParse/safeParseAsync.ts index 89c7bc666..7b78e5ea8 100644 --- a/library/src/methods/safeParse/safeParseAsync.ts +++ b/library/src/methods/safeParse/safeParseAsync.ts @@ -4,11 +4,9 @@ import type { SafeParseResult } from './types.ts'; /** * Parses unknown input based on a schema. - * * @param schema The schema to be used. * @param input The input to be parsed. * @param info The optional parse info. - * * @returns The parsed output. */ export async function safeParseAsync< diff --git a/library/src/methods/strict/strict.ts b/library/src/methods/strict/strict.ts index 2e7cf95be..50c3ab58e 100644 --- a/library/src/methods/strict/strict.ts +++ b/library/src/methods/strict/strict.ts @@ -5,10 +5,8 @@ import { getSchemaIssues } from '../../utils/index.ts'; /** * Creates a strict object schema that throws an error if an input contains * unknown keys. - * * @param schema A object schema. * @param error The error message. - * * @returns A strict object schema. */ export function strict>( @@ -20,10 +18,8 @@ export function strict>( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/strict/strictAsync.ts b/library/src/methods/strict/strictAsync.ts index 0087d4f49..a0f5dffa5 100644 --- a/library/src/methods/strict/strictAsync.ts +++ b/library/src/methods/strict/strictAsync.ts @@ -5,10 +5,8 @@ import { getSchemaIssues } from '../../utils/index.ts'; /** * Creates a strict async object schema that throws an error if an input * contains unknown keys. - * * @param schema A object schema. * @param error The error message. - * * @returns A strict object schema. */ export function strictAsync>( @@ -20,10 +18,8 @@ export function strictAsync>( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/strip/strip.ts b/library/src/methods/strip/strip.ts index 92db62cc7..9f2c0301d 100644 --- a/library/src/methods/strip/strip.ts +++ b/library/src/methods/strip/strip.ts @@ -3,9 +3,7 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates an object schema that strips unknown keys. - * * @param schema A object schema. - * * @returns A object schema. */ export function strip>( @@ -20,10 +18,8 @@ export function strip>( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/strip/stripAsync.ts b/library/src/methods/strip/stripAsync.ts index 8d98b1d1d..5e4ebf0ce 100644 --- a/library/src/methods/strip/stripAsync.ts +++ b/library/src/methods/strip/stripAsync.ts @@ -3,9 +3,7 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates an object schema that strips unknown keys. - * * @param schema A object schema. - * * @returns A object schema. */ export function stripAsync>( @@ -20,10 +18,8 @@ export function stripAsync>( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/transform/transform.ts b/library/src/methods/transform/transform.ts index d1730aa21..328f2e35d 100644 --- a/library/src/methods/transform/transform.ts +++ b/library/src/methods/transform/transform.ts @@ -210,10 +210,8 @@ export function transform( /** * Adds a transformation step to a schema, which is executed at the end of * parsing and can change the output type. - * * @param schema The schema to be used. * @param action The transformation action. - * * @returns A transformed schema. */ export function transform( @@ -225,10 +223,8 @@ export function transform( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/transform/transformAsync.ts b/library/src/methods/transform/transformAsync.ts index 3065d9df7..b3bf433f0 100644 --- a/library/src/methods/transform/transformAsync.ts +++ b/library/src/methods/transform/transformAsync.ts @@ -356,10 +356,8 @@ export function transformAsync< /** * Adds an async transformation step to a schema, which is executed at the end * of parsing and can change the output type. - * * @param schema The schema to be used. * @param action The transformation action. - * * @returns A transformed schema. */ export function transformAsync< @@ -379,10 +377,8 @@ export function transformAsync< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/unwrap/unwrap.ts b/library/src/methods/unwrap/unwrap.ts index 45921b4aa..60daa22cf 100644 --- a/library/src/methods/unwrap/unwrap.ts +++ b/library/src/methods/unwrap/unwrap.ts @@ -15,9 +15,7 @@ import type { /** * Unwraps the wrapped schema. - * * @param schema The schema to be unwrapped. - * * @returns The unwrapped schema. */ export function unwrap< diff --git a/library/src/methods/withDefault/withDefault.ts b/library/src/methods/withDefault/withDefault.ts index 477f908cd..8468893fe 100644 --- a/library/src/methods/withDefault/withDefault.ts +++ b/library/src/methods/withDefault/withDefault.ts @@ -2,12 +2,9 @@ import type { BaseSchema, BaseSchemaAsync, Input } from '../../types.ts'; /** * Passes a default value to a schema in case of an undefined input. - * * @deprecated Use `optional` instead. - * * @param schema The affected schema. * @param value The default value. - * * @returns The passed schema. */ export function withDefault( @@ -19,10 +16,8 @@ export function withDefault( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { @@ -40,7 +35,6 @@ export function withDefault( /** * See {@link withDefault} - * * @deprecated Use `optional` instead. */ export const useDefault = withDefault; diff --git a/library/src/schemas/any/any.ts b/library/src/schemas/any/any.ts index ae30f4fd1..95ce26467 100644 --- a/library/src/schemas/any/any.ts +++ b/library/src/schemas/any/any.ts @@ -10,9 +10,7 @@ export type AnySchema = BaseSchema & { /** * Creates a any schema. - * * @param pipe A validation and transformation pipe. - * * @returns A any schema. */ export function any(pipe: Pipe = []): AnySchema { @@ -29,10 +27,8 @@ export function any(pipe: Pipe = []): AnySchema { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/any/anyAsync.ts b/library/src/schemas/any/anyAsync.ts index 1e56b2539..48f09ebdd 100644 --- a/library/src/schemas/any/anyAsync.ts +++ b/library/src/schemas/any/anyAsync.ts @@ -10,9 +10,7 @@ export type AnySchemaAsync = BaseSchemaAsync & { /** * Creates an async any schema. - * * @param pipe A validation and transformation pipe. - * * @returns An async any schema. */ export function anyAsync(pipe: PipeAsync = []): AnySchemaAsync { @@ -29,10 +27,8 @@ export function anyAsync(pipe: PipeAsync = []): AnySchemaAsync { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/array/array.ts b/library/src/schemas/array/array.ts index fc09a7469..e239e76a9 100644 --- a/library/src/schemas/array/array.ts +++ b/library/src/schemas/array/array.ts @@ -27,10 +27,8 @@ export type ArraySchema< /** * Creates a array schema. - * * @param item The item schema. * @param pipe A validation and transformation pipe. - * * @returns A array schema. */ export function array( @@ -40,11 +38,9 @@ export function array( /** * Creates a array schema. - * * @param item The item schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A array schema. */ export function array( @@ -53,6 +49,12 @@ export function array( pipe?: Pipe[]> ): ArraySchema; +/** + * + * @param item + * @param arg2 + * @param arg3 + */ export function array( item: TArrayItem, arg2?: ErrorMessage | Pipe[]>, @@ -80,10 +82,8 @@ export function array( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/array/arrayAsync.ts b/library/src/schemas/array/arrayAsync.ts index 496be7f90..e049a57dc 100644 --- a/library/src/schemas/array/arrayAsync.ts +++ b/library/src/schemas/array/arrayAsync.ts @@ -28,10 +28,8 @@ export type ArraySchemaAsync< /** * Creates an async array schema. - * * @param item The item schema. * @param pipe A validation and transformation pipe. - * * @returns An async array schema. */ export function arrayAsync( @@ -41,11 +39,9 @@ export function arrayAsync( /** * Creates an async array schema. - * * @param item The item schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async array schema. */ export function arrayAsync( @@ -54,6 +50,12 @@ export function arrayAsync( pipe?: PipeAsync[]> ): ArraySchemaAsync; +/** + * + * @param item + * @param arg2 + * @param arg3 + */ export function arrayAsync( item: TArrayItem, arg2?: ErrorMessage | PipeAsync[]>, @@ -81,10 +83,8 @@ export function arrayAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/bigint/bigint.ts b/library/src/schemas/bigint/bigint.ts index 422a8b087..93b356d79 100644 --- a/library/src/schemas/bigint/bigint.ts +++ b/library/src/schemas/bigint/bigint.ts @@ -14,23 +14,24 @@ export type BigintSchema = BaseSchema & { /** * Creates a bigint schema. - * * @param pipe A validation and transformation pipe. - * * @returns A bigint schema. */ export function bigint(pipe?: Pipe): BigintSchema; /** * Creates a bigint schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A bigint schema. */ export function bigint(error?: ErrorMessage, pipe?: Pipe): BigintSchema; +/** + * + * @param arg1 + * @param arg2 + */ export function bigint( arg1?: ErrorMessage | Pipe, arg2?: Pipe @@ -52,10 +53,8 @@ export function bigint( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/bigint/bigintAsync.ts b/library/src/schemas/bigint/bigintAsync.ts index a1bbb1d44..59d4bdc40 100644 --- a/library/src/schemas/bigint/bigintAsync.ts +++ b/library/src/schemas/bigint/bigintAsync.ts @@ -17,19 +17,15 @@ export type BigintSchemaAsync = BaseSchemaAsync< /** * Creates an async bigint schema. - * * @param pipe A validation and transformation pipe. - * * @returns An async bigint schema. */ export function bigintAsync(pipe?: PipeAsync): BigintSchemaAsync; /** * Creates an async bigint schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async bigint schema. */ export function bigintAsync( @@ -37,6 +33,11 @@ export function bigintAsync( pipe?: PipeAsync ): BigintSchemaAsync; +/** + * + * @param arg1 + * @param arg2 + */ export function bigintAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync @@ -58,10 +59,8 @@ export function bigintAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/blob/blob.ts b/library/src/schemas/blob/blob.ts index 605e1b2ad..b893e1b66 100644 --- a/library/src/schemas/blob/blob.ts +++ b/library/src/schemas/blob/blob.ts @@ -14,23 +14,24 @@ export type BlobSchema = BaseSchema & { /** * Creates a blob schema. - * * @param pipe A validation and transformation pipe. - * * @returns A blob schema. */ export function blob(pipe?: Pipe): BlobSchema; /** * Creates a blob schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A blob schema. */ export function blob(error?: ErrorMessage, pipe?: Pipe): BlobSchema; +/** + * + * @param arg1 + * @param arg2 + */ export function blob( arg1?: ErrorMessage | Pipe, arg2?: Pipe @@ -52,10 +53,8 @@ export function blob( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/blob/blobAsync.ts b/library/src/schemas/blob/blobAsync.ts index 4a92a3c28..16e2482cd 100644 --- a/library/src/schemas/blob/blobAsync.ts +++ b/library/src/schemas/blob/blobAsync.ts @@ -14,19 +14,15 @@ export type BlobSchemaAsync = BaseSchemaAsync & { /** * Creates an async blob schema. - * * @param pipe A validation and transformation pipe. - * * @returns An async blob schema. */ export function blobAsync(pipe?: PipeAsync): BlobSchemaAsync; /** * Creates an async blob schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async blob schema. */ export function blobAsync( @@ -34,6 +30,11 @@ export function blobAsync( pipe?: PipeAsync ): BlobSchemaAsync; +/** + * + * @param arg1 + * @param arg2 + */ export function blobAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync @@ -55,10 +56,8 @@ export function blobAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/boolean/boolean.ts b/library/src/schemas/boolean/boolean.ts index bc39675f3..0c79aea0e 100644 --- a/library/src/schemas/boolean/boolean.ts +++ b/library/src/schemas/boolean/boolean.ts @@ -14,19 +14,15 @@ export type BooleanSchema = BaseSchema & { /** * Creates a boolean schema. - * * @param pipe A validation and transformation pipe. - * * @returns A boolean schema. */ export function boolean(pipe?: Pipe): BooleanSchema; /** * Creates a boolean schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A boolean schema. */ export function boolean( @@ -34,6 +30,11 @@ export function boolean( pipe?: Pipe ): BooleanSchema; +/** + * + * @param arg1 + * @param arg2 + */ export function boolean( arg1?: ErrorMessage | Pipe, arg2?: Pipe @@ -55,10 +56,8 @@ export function boolean( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/boolean/booleanAsync.ts b/library/src/schemas/boolean/booleanAsync.ts index 5001eadac..e07cd40c6 100644 --- a/library/src/schemas/boolean/booleanAsync.ts +++ b/library/src/schemas/boolean/booleanAsync.ts @@ -17,19 +17,15 @@ export type BooleanSchemaAsync = BaseSchemaAsync< /** * Creates an async boolean schema. - * * @param pipe A validation and transformation pipe. - * * @returns An async boolean schema. */ export function booleanAsync(pipe?: PipeAsync): BooleanSchemaAsync; /** * Creates an async boolean schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async boolean schema. */ export function booleanAsync( @@ -37,6 +33,11 @@ export function booleanAsync( pipe?: PipeAsync ): BooleanSchemaAsync; +/** + * + * @param arg1 + * @param arg2 + */ export function booleanAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync @@ -58,10 +59,8 @@ export function booleanAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/date/date.ts b/library/src/schemas/date/date.ts index 787bb63d5..a7a083a26 100644 --- a/library/src/schemas/date/date.ts +++ b/library/src/schemas/date/date.ts @@ -14,23 +14,24 @@ export type DateSchema = BaseSchema & { /** * Creates a date schema. - * * @param pipe A validation and transformation pipe. - * * @returns A date schema. */ export function date(pipe?: Pipe): DateSchema; /** * Creates a date schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A date schema. */ export function date(error?: ErrorMessage, pipe?: Pipe): DateSchema; +/** + * + * @param arg1 + * @param arg2 + */ export function date( arg1?: ErrorMessage | Pipe, arg2?: Pipe @@ -52,10 +53,8 @@ export function date( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/date/dateAsync.ts b/library/src/schemas/date/dateAsync.ts index 6ed8a3b1c..a10489edd 100644 --- a/library/src/schemas/date/dateAsync.ts +++ b/library/src/schemas/date/dateAsync.ts @@ -14,19 +14,15 @@ export type DateSchemaAsync = BaseSchemaAsync & { /** * Creates an async date schema. - * * @param pipe A validation and transformation pipe. - * * @returns An async date schema. */ export function dateAsync(pipe?: PipeAsync): DateSchemaAsync; /** * Creates an async date schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async date schema. */ export function dateAsync( @@ -34,6 +30,11 @@ export function dateAsync( pipe?: PipeAsync ): DateSchemaAsync; +/** + * + * @param arg1 + * @param arg2 + */ export function dateAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync @@ -55,10 +56,8 @@ export function dateAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/enumType/enumType.ts b/library/src/schemas/enumType/enumType.ts index 7d4027266..1efad775e 100644 --- a/library/src/schemas/enumType/enumType.ts +++ b/library/src/schemas/enumType/enumType.ts @@ -15,10 +15,8 @@ export type EnumSchema< /** * Creates a enum schema. - * * @param enumValue The enum value. * @param error The error message. - * * @returns A enum schema. */ export function enumType>( @@ -43,10 +41,8 @@ export function enumType>( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/enumType/enumTypeAsync.ts b/library/src/schemas/enumType/enumTypeAsync.ts index 7e7f70d5e..9a9e3798a 100644 --- a/library/src/schemas/enumType/enumTypeAsync.ts +++ b/library/src/schemas/enumType/enumTypeAsync.ts @@ -15,10 +15,8 @@ export type EnumSchemaAsync< /** * Creates an async enum schema. - * * @param enumValue The enum value. * @param error The error message. - * * @returns An async enum schema. */ export function enumTypeAsync< @@ -43,10 +41,8 @@ export function enumTypeAsync< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/instance/instance.ts b/library/src/schemas/instance/instance.ts index bb72ac43c..28ad6289f 100644 --- a/library/src/schemas/instance/instance.ts +++ b/library/src/schemas/instance/instance.ts @@ -23,10 +23,8 @@ export type InstanceSchema< /** * Creates an instance schema. - * * @param of The class of the instance. * @param pipe A validation and transformation pipe. - * * @returns An instance schema. */ export function instance( @@ -36,11 +34,9 @@ export function instance( /** * Creates an instance schema. - * * @param of The class of the instance. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An instance schema. */ export function instance( @@ -49,6 +45,12 @@ export function instance( pipe?: Pipe> ): InstanceSchema; +/** + * + * @param of + * @param arg2 + * @param arg3 + */ export function instance( of: TClass, arg2?: Pipe> | ErrorMessage, @@ -76,10 +78,8 @@ export function instance( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/instance/instanceAsync.ts b/library/src/schemas/instance/instanceAsync.ts index a2a029de8..c19f813f6 100644 --- a/library/src/schemas/instance/instanceAsync.ts +++ b/library/src/schemas/instance/instanceAsync.ts @@ -19,10 +19,8 @@ export type InstanceSchemaAsync< /** * Creates an async instance schema. - * * @param of The class of the instance. * @param pipe A validation and transformation pipe. - * * @returns An async instance schema. */ export function instanceAsync( @@ -32,11 +30,9 @@ export function instanceAsync( /** * Creates an async instance schema. - * * @param of The class of the instance. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async instance schema. */ export function instanceAsync( @@ -45,6 +41,12 @@ export function instanceAsync( pipe?: PipeAsync> ): InstanceSchemaAsync; +/** + * + * @param of + * @param arg2 + * @param arg3 + */ export function instanceAsync( of: TClass, arg2?: PipeAsync> | ErrorMessage, @@ -72,10 +74,8 @@ export function instanceAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/intersection/intersection.ts b/library/src/schemas/intersection/intersection.ts index 9a4c5b108..0a90db091 100644 --- a/library/src/schemas/intersection/intersection.ts +++ b/library/src/schemas/intersection/intersection.ts @@ -25,10 +25,8 @@ export type IntersectionSchema< /** * Creates an intersection schema. - * * @param intersection The intersection schema. * @param error The error message. - * * @returns An intersection schema. */ export function intersection( @@ -53,10 +51,8 @@ export function intersection( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/intersection/intersectionAsync.ts b/library/src/schemas/intersection/intersectionAsync.ts index 09d00fd4c..9a7105fe1 100644 --- a/library/src/schemas/intersection/intersectionAsync.ts +++ b/library/src/schemas/intersection/intersectionAsync.ts @@ -25,10 +25,8 @@ export type IntersectionSchemaAsync< /** * Creates an async intersection schema. - * * @param intersection The intersection schema. * @param error The error message. - * * @returns An async intersection schema. */ export function intersectionAsync< @@ -55,10 +53,8 @@ export function intersectionAsync< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/intersection/utils/mergeOutputs/mergeOutputs.ts b/library/src/schemas/intersection/utils/mergeOutputs/mergeOutputs.ts index 51382edae..0905c0fe7 100644 --- a/library/src/schemas/intersection/utils/mergeOutputs/mergeOutputs.ts +++ b/library/src/schemas/intersection/utils/mergeOutputs/mergeOutputs.ts @@ -2,10 +2,8 @@ import { getOutput } from '../../../../utils/index.ts'; /** * Merges two outputs into one single output. - * * @param output1 First output. * @param output2 Second output. - * * @returns The merged output. */ export function mergeOutputs( diff --git a/library/src/schemas/literal/literal.ts b/library/src/schemas/literal/literal.ts index afe725052..83aea20ef 100644 --- a/library/src/schemas/literal/literal.ts +++ b/library/src/schemas/literal/literal.ts @@ -15,10 +15,8 @@ export type LiteralSchema< /** * Creates a literal schema. - * * @param literal The literal value. * @param error The error message. - * * @returns A literal schema. */ export function literal( @@ -43,10 +41,8 @@ export function literal( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/literal/literalAsync.ts b/library/src/schemas/literal/literalAsync.ts index 1fdb1fa6c..ee45c544c 100644 --- a/library/src/schemas/literal/literalAsync.ts +++ b/library/src/schemas/literal/literalAsync.ts @@ -15,10 +15,8 @@ export type LiteralSchemaAsync< /** * Creates an async literal schema. - * * @param literal The literal value. * @param error The error message. - * * @returns An async literal schema. */ export function literalAsync( @@ -43,10 +41,8 @@ export function literalAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/map/map.ts b/library/src/schemas/map/map.ts index 33c371ddd..63d4a37a6 100644 --- a/library/src/schemas/map/map.ts +++ b/library/src/schemas/map/map.ts @@ -27,11 +27,9 @@ export type MapSchema< /** * Creates a map schema. - * * @param key The key schema. * @param value The value schema. * @param pipe A validation and transformation pipe. - * * @returns A map schema. */ export function map( @@ -42,12 +40,10 @@ export function map( /** * Creates a map schema. - * * @param key The key schema. * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A map schema. */ export function map( @@ -57,6 +53,13 @@ export function map( pipe?: Pipe> ): MapSchema; +/** + * + * @param key + * @param value + * @param arg3 + * @param arg4 + */ export function map( key: TMapKey, value: TMapValue, @@ -85,10 +88,8 @@ export function map( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/map/mapAsync.ts b/library/src/schemas/map/mapAsync.ts index e1a7ef29b..ded6023df 100644 --- a/library/src/schemas/map/mapAsync.ts +++ b/library/src/schemas/map/mapAsync.ts @@ -28,11 +28,9 @@ export type MapSchemaAsync< /** * Creates an async map schema. - * * @param key The key schema. * @param value The value schema. * @param pipe A validation and transformation pipe. - * * @returns An async map schema. */ export function mapAsync< @@ -46,12 +44,10 @@ export function mapAsync< /** * Creates an async map schema. - * * @param key The key schema. * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async map schema. */ export function mapAsync< @@ -64,6 +60,13 @@ export function mapAsync< pipe?: PipeAsync> ): MapSchemaAsync; +/** + * + * @param key + * @param value + * @param arg3 + * @param arg4 + */ export function mapAsync< TMapKey extends BaseSchema | BaseSchemaAsync, TMapValue extends BaseSchema | BaseSchemaAsync @@ -95,10 +98,8 @@ export function mapAsync< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nan/nan.ts b/library/src/schemas/nan/nan.ts index 392cc622f..c7c792b19 100644 --- a/library/src/schemas/nan/nan.ts +++ b/library/src/schemas/nan/nan.ts @@ -10,9 +10,7 @@ export type NanSchema = BaseSchema & { /** * Creates a NaN schema. - * * @param error The error message. - * * @returns A NaN schema. */ export function nan(error?: ErrorMessage): NanSchema { @@ -29,10 +27,8 @@ export function nan(error?: ErrorMessage): NanSchema { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nan/nanAsync.ts b/library/src/schemas/nan/nanAsync.ts index 399124057..8499e8296 100644 --- a/library/src/schemas/nan/nanAsync.ts +++ b/library/src/schemas/nan/nanAsync.ts @@ -13,9 +13,7 @@ export type NanSchemaAsync = BaseSchemaAsync< /** * Creates an async NaN schema. - * * @param error The error message. - * * @returns An async NaN schema. */ export function nanAsync(error?: ErrorMessage): NanSchemaAsync { @@ -32,10 +30,8 @@ export function nanAsync(error?: ErrorMessage): NanSchemaAsync { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nativeEnum/nativeEnum.ts b/library/src/schemas/nativeEnum/nativeEnum.ts index a8677e569..d35d35b44 100644 --- a/library/src/schemas/nativeEnum/nativeEnum.ts +++ b/library/src/schemas/nativeEnum/nativeEnum.ts @@ -22,10 +22,8 @@ export type NativeEnumSchema< /** * Creates a enum schema. - * * @param nativeEnum The native enum value. * @param error The error message. - * * @returns A enum schema. */ export function nativeEnum( @@ -50,10 +48,8 @@ export function nativeEnum( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nativeEnum/nativeEnumAsync.ts b/library/src/schemas/nativeEnum/nativeEnumAsync.ts index 4e013eced..9d03fd9b2 100644 --- a/library/src/schemas/nativeEnum/nativeEnumAsync.ts +++ b/library/src/schemas/nativeEnum/nativeEnumAsync.ts @@ -15,10 +15,8 @@ export type NativeEnumSchemaAsync< /** * Creates an async enum schema. - * * @param nativeEnum The native enum value. * @param error The error message. - * * @returns An async enum schema. */ export function nativeEnumAsync( @@ -43,10 +41,8 @@ export function nativeEnumAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/never/never.ts b/library/src/schemas/never/never.ts index b78b7e6ca..42de00dcf 100644 --- a/library/src/schemas/never/never.ts +++ b/library/src/schemas/never/never.ts @@ -10,9 +10,7 @@ export type NeverSchema = BaseSchema & { /** * Creates a never schema. - * * @param error The error message. - * * @returns A never schema. */ export function never(error?: ErrorMessage): NeverSchema { @@ -29,10 +27,8 @@ export function never(error?: ErrorMessage): NeverSchema { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/never/neverAsync.ts b/library/src/schemas/never/neverAsync.ts index a6ee452d1..d00b9669f 100644 --- a/library/src/schemas/never/neverAsync.ts +++ b/library/src/schemas/never/neverAsync.ts @@ -10,9 +10,7 @@ export type NeverSchemaAsync = BaseSchemaAsync & { /** * Creates an async never schema. - * * @param error The error message. - * * @returns An async never schema. */ export function neverAsync(error?: ErrorMessage): NeverSchemaAsync { @@ -29,10 +27,8 @@ export function neverAsync(error?: ErrorMessage): NeverSchemaAsync { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nonNullable/nonNullable.ts b/library/src/schemas/nonNullable/nonNullable.ts index b378b0f2a..f26555a28 100644 --- a/library/src/schemas/nonNullable/nonNullable.ts +++ b/library/src/schemas/nonNullable/nonNullable.ts @@ -19,10 +19,8 @@ export type NonNullableSchema< /** * Creates a non nullable schema. - * * @param wrapped The wrapped schema. * @param error The error message. - * * @returns A non nullable schema. */ export function nonNullable( @@ -47,10 +45,8 @@ export function nonNullable( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nonNullable/nonNullableAsync.ts b/library/src/schemas/nonNullable/nonNullableAsync.ts index fb8308c40..0ef11e820 100644 --- a/library/src/schemas/nonNullable/nonNullableAsync.ts +++ b/library/src/schemas/nonNullable/nonNullableAsync.ts @@ -21,10 +21,8 @@ export type NonNullableSchemaAsync< /** * Creates an async non nullable schema. - * * @param wrapped The wrapped schema. * @param error The error message. - * * @returns An async non nullable schema. */ export function nonNullableAsync( @@ -49,10 +47,8 @@ export function nonNullableAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nonNullish/nonNullish.ts b/library/src/schemas/nonNullish/nonNullish.ts index 87929d51d..db2c8376b 100644 --- a/library/src/schemas/nonNullish/nonNullish.ts +++ b/library/src/schemas/nonNullish/nonNullish.ts @@ -19,10 +19,8 @@ export type NonNullishSchema< /** * Creates a non nullish schema. - * * @param wrapped The wrapped schema. * @param error The error message. - * * @returns A non nullish schema. */ export function nonNullish( @@ -47,10 +45,8 @@ export function nonNullish( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nonNullish/nonNullishAsync.ts b/library/src/schemas/nonNullish/nonNullishAsync.ts index f237558f1..707ccca95 100644 --- a/library/src/schemas/nonNullish/nonNullishAsync.ts +++ b/library/src/schemas/nonNullish/nonNullishAsync.ts @@ -21,10 +21,8 @@ export type NonNullishSchemaAsync< /** * Creates an async non nullish schema. - * * @param wrapped The wrapped schema. * @param error The error message. - * * @returns An async non nullish schema. */ export function nonNullishAsync( @@ -49,10 +47,8 @@ export function nonNullishAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nonOptional/nonOptional.ts b/library/src/schemas/nonOptional/nonOptional.ts index bffca36db..c132d48e0 100644 --- a/library/src/schemas/nonOptional/nonOptional.ts +++ b/library/src/schemas/nonOptional/nonOptional.ts @@ -19,10 +19,8 @@ export type NonOptionalSchema< /** * Creates a non optional schema. - * * @param wrapped The wrapped schema. * @param error The error message. - * * @returns A non optional schema. */ export function nonOptional( @@ -47,10 +45,8 @@ export function nonOptional( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nonOptional/nonOptionalAsync.ts b/library/src/schemas/nonOptional/nonOptionalAsync.ts index e35e1218e..878f3d4b3 100644 --- a/library/src/schemas/nonOptional/nonOptionalAsync.ts +++ b/library/src/schemas/nonOptional/nonOptionalAsync.ts @@ -21,10 +21,8 @@ export type NonOptionalSchemaAsync< /** * Creates an async non optional schema. - * * @param wrapped The wrapped schema. * @param error The error message. - * * @returns An async non optional schema. */ export function nonOptionalAsync( @@ -49,10 +47,8 @@ export function nonOptionalAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nullType/nullType.ts b/library/src/schemas/nullType/nullType.ts index 6c4a5db2b..2deef8459 100644 --- a/library/src/schemas/nullType/nullType.ts +++ b/library/src/schemas/nullType/nullType.ts @@ -10,9 +10,7 @@ export type NullSchema = BaseSchema & { /** * Creates a null schema. - * * @param error The error message. - * * @returns A null schema. */ export function nullType(error?: ErrorMessage): NullSchema { @@ -29,10 +27,8 @@ export function nullType(error?: ErrorMessage): NullSchema { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nullType/nullTypeAsync.ts b/library/src/schemas/nullType/nullTypeAsync.ts index 43316a0b6..e56e0a6c3 100644 --- a/library/src/schemas/nullType/nullTypeAsync.ts +++ b/library/src/schemas/nullType/nullTypeAsync.ts @@ -10,9 +10,7 @@ export type NullSchemaAsync = BaseSchemaAsync & { /** * Creates an async null schema. - * * @param error The error message. - * * @returns An async null schema. */ export function nullTypeAsync(error?: ErrorMessage): NullSchemaAsync { @@ -29,10 +27,8 @@ export function nullTypeAsync(error?: ErrorMessage): NullSchemaAsync { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nullable/nullable.ts b/library/src/schemas/nullable/nullable.ts index 1747d128d..965648681 100644 --- a/library/src/schemas/nullable/nullable.ts +++ b/library/src/schemas/nullable/nullable.ts @@ -18,10 +18,8 @@ export type NullableSchema< /** * Creates a nullable schema. - * * @param wrapped The wrapped schema. * @param default_ The default value. - * * @returns A nullable schema. */ export function nullable< @@ -58,10 +56,8 @@ export function nullable< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nullable/nullableAsync.ts b/library/src/schemas/nullable/nullableAsync.ts index 02dea8d99..5dc37174c 100644 --- a/library/src/schemas/nullable/nullableAsync.ts +++ b/library/src/schemas/nullable/nullableAsync.ts @@ -26,10 +26,8 @@ export type NullableSchemaAsync< /** * Creates an async nullable schema. - * * @param wrapped The wrapped schema. * @param default_ The default value. - * * @returns An async nullable schema. */ export function nullableAsync< @@ -69,10 +67,8 @@ export function nullableAsync< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nullish/nullish.ts b/library/src/schemas/nullish/nullish.ts index 27c89ad35..f70eb82f8 100644 --- a/library/src/schemas/nullish/nullish.ts +++ b/library/src/schemas/nullish/nullish.ts @@ -18,10 +18,8 @@ export type NullishSchema< /** * Creates a nullish schema. - * * @param wrapped The wrapped schema. * @param default_ The default value. - * * @returns A nullish schema. */ export function nullish< @@ -58,10 +56,8 @@ export function nullish< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nullish/nullishAsync.ts b/library/src/schemas/nullish/nullishAsync.ts index 0ba86e1b0..255339b05 100644 --- a/library/src/schemas/nullish/nullishAsync.ts +++ b/library/src/schemas/nullish/nullishAsync.ts @@ -26,10 +26,8 @@ export type NullishSchemaAsync< /** * Creates an async nullish schema. - * * @param wrapped The wrapped schema. * @param default_ The default value. - * * @returns An async nullish schema. */ export function nullishAsync< @@ -69,10 +67,8 @@ export function nullishAsync< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/number/number.ts b/library/src/schemas/number/number.ts index eb881ca60..dce4addbf 100644 --- a/library/src/schemas/number/number.ts +++ b/library/src/schemas/number/number.ts @@ -14,23 +14,24 @@ export type NumberSchema = BaseSchema & { /** * Creates a number schema. - * * @param pipe A validation and transformation pipe. - * * @returns A number schema. */ export function number(pipe?: Pipe): NumberSchema; /** * Creates a number schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A number schema. */ export function number(error?: ErrorMessage, pipe?: Pipe): NumberSchema; +/** + * + * @param arg1 + * @param arg2 + */ export function number( arg1?: ErrorMessage | Pipe, arg2?: Pipe @@ -52,10 +53,8 @@ export function number( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/number/numberAsync.ts b/library/src/schemas/number/numberAsync.ts index 6f9a3eba5..93766ca0d 100644 --- a/library/src/schemas/number/numberAsync.ts +++ b/library/src/schemas/number/numberAsync.ts @@ -17,19 +17,15 @@ export type NumberSchemaAsync = BaseSchemaAsync< /** * Creates an async number schema. - * * @param pipe A validation and transformation pipe. - * * @returns An async number schema. */ export function numberAsync(pipe?: PipeAsync): NumberSchemaAsync; /** * Creates an async number schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async number schema. */ export function numberAsync( @@ -37,6 +33,11 @@ export function numberAsync( pipe?: PipeAsync ): NumberSchemaAsync; +/** + * + * @param arg1 + * @param arg2 + */ export function numberAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync @@ -58,10 +59,8 @@ export function numberAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/object/object.ts b/library/src/schemas/object/object.ts index 068c69d8c..b9f4762d6 100644 --- a/library/src/schemas/object/object.ts +++ b/library/src/schemas/object/object.ts @@ -25,10 +25,8 @@ export type ObjectSchema< /** * Creates an object schema. - * * @param object The object schema. * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function object( @@ -38,11 +36,9 @@ export function object( /** * Creates an object schema. - * * @param object The object schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An object schema. */ export function object( @@ -51,6 +47,12 @@ export function object( pipe?: Pipe> ): ObjectSchema; +/** + * + * @param object + * @param arg2 + * @param arg3 + */ export function object( object: TObjectShape, arg2?: Pipe> | ErrorMessage, @@ -81,10 +83,8 @@ export function object( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/object/objectAsync.ts b/library/src/schemas/object/objectAsync.ts index f57a6e093..83571f077 100644 --- a/library/src/schemas/object/objectAsync.ts +++ b/library/src/schemas/object/objectAsync.ts @@ -34,10 +34,8 @@ export type ObjectSchemaAsync< /** * Creates an async object schema. - * * @param object The object schema. * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function objectAsync( @@ -47,11 +45,9 @@ export function objectAsync( /** * Creates an async object schema. - * * @param object The object schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async object schema. */ export function objectAsync( @@ -60,6 +56,12 @@ export function objectAsync( pipe?: PipeAsync> ): ObjectSchemaAsync; +/** + * + * @param object + * @param arg2 + * @param arg3 + */ export function objectAsync( object: TObjectShape, arg2?: PipeAsync> | ErrorMessage, @@ -90,10 +92,8 @@ export function objectAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/optional/optional.ts b/library/src/schemas/optional/optional.ts index 6c43b79a2..b682ee3b9 100644 --- a/library/src/schemas/optional/optional.ts +++ b/library/src/schemas/optional/optional.ts @@ -18,10 +18,8 @@ export type OptionalSchema< /** * Creates a optional schema. - * * @param wrapped The wrapped schema. * @param default_ The default value. - * * @returns A optional schema. */ export function optional< @@ -58,10 +56,8 @@ export function optional< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/optional/optionalAsync.ts b/library/src/schemas/optional/optionalAsync.ts index b5ea8ee1e..685b65571 100644 --- a/library/src/schemas/optional/optionalAsync.ts +++ b/library/src/schemas/optional/optionalAsync.ts @@ -26,10 +26,8 @@ export type OptionalSchemaAsync< /** * Creates an async optional schema. - * * @param wrapped The wrapped schema. * @param default_ The default value. - * * @returns An async optional schema. */ export function optionalAsync< @@ -69,10 +67,8 @@ export function optionalAsync< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/record/record.ts b/library/src/schemas/record/record.ts index bdc5b9225..fa0446863 100644 --- a/library/src/schemas/record/record.ts +++ b/library/src/schemas/record/record.ts @@ -29,10 +29,8 @@ export type RecordSchema< /** * Creates a record schema. - * * @param value The value schema. * @param pipe A validation and transformation pipe. - * * @returns A record schema. */ export function record( @@ -42,11 +40,9 @@ export function record( /** * Creates a record schema. - * * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A record schema. */ export function record( @@ -57,11 +53,9 @@ export function record( /** * Creates a record schema. - * * @param key The key schema. * @param value The value schema. * @param pipe A validation and transformation pipe. - * * @returns A record schema. */ export function record< @@ -75,12 +69,10 @@ export function record< /** * Creates a record schema. - * * @param key The key schema. * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A record schema. */ export function record< @@ -93,6 +85,13 @@ export function record< pipe?: Pipe> ): RecordSchema; +/** + * + * @param arg1 + * @param arg2 + * @param arg3 + * @param arg4 + */ export function record< TRecordKey extends RecordKey, TRecordValue extends BaseSchema @@ -131,10 +130,8 @@ export function record< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/record/recordAsync.ts b/library/src/schemas/record/recordAsync.ts index 7297b147c..e4f3f210c 100644 --- a/library/src/schemas/record/recordAsync.ts +++ b/library/src/schemas/record/recordAsync.ts @@ -45,10 +45,8 @@ export type RecordSchemaAsync< /** * Creates an async record schema. - * * @param value The value schema. * @param pipe A validation and transformation pipe. - * * @returns An async record schema. */ export function recordAsync( @@ -58,11 +56,9 @@ export function recordAsync( /** * Creates an async record schema. - * * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async record schema. */ export function recordAsync( @@ -73,11 +69,9 @@ export function recordAsync( /** * Creates an async record schema. - * * @param key The key schema. * @param value The value schema. * @param pipe A validation and transformation pipe. - * * @returns An async record schema. */ export function recordAsync< @@ -91,12 +85,10 @@ export function recordAsync< /** * Creates an async record schema. - * * @param key The key schema. * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async record schema. */ export function recordAsync< @@ -109,6 +101,13 @@ export function recordAsync< pipe?: PipeAsync> ): RecordSchemaAsync; +/** + * + * @param arg1 + * @param arg2 + * @param arg3 + * @param arg4 + */ export function recordAsync< TRecordKey extends RecordKeyAsync, TRecordValue extends BaseSchema | BaseSchemaAsync @@ -147,10 +146,8 @@ export function recordAsync< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/record/utils/getRecordArgs/getRecordArgs.ts b/library/src/schemas/record/utils/getRecordArgs/getRecordArgs.ts index 28af310d8..756143a3f 100644 --- a/library/src/schemas/record/utils/getRecordArgs/getRecordArgs.ts +++ b/library/src/schemas/record/utils/getRecordArgs/getRecordArgs.ts @@ -12,12 +12,10 @@ import type { RecordKeyAsync } from '../../recordAsync.ts'; /** * Returns key, value, error and pipe from dynamic arguments. - * * @param arg1 First argument. * @param arg2 Second argument. * @param arg3 Third argument. * @param arg4 Fourth argument. - * * @returns The record arguments. */ export function getRecordArgs< diff --git a/library/src/schemas/recursive/recursive.ts b/library/src/schemas/recursive/recursive.ts index 547e34ea0..129c73c99 100644 --- a/library/src/schemas/recursive/recursive.ts +++ b/library/src/schemas/recursive/recursive.ts @@ -13,9 +13,7 @@ export type RecursiveSchema< /** * Creates a recursive schema. - * * @param getter The schema getter. - * * @returns A recursive schema. */ export function recursive BaseSchema>( @@ -39,10 +37,8 @@ export function recursive BaseSchema>( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/recursive/recursiveAsync.ts b/library/src/schemas/recursive/recursiveAsync.ts index f045ec307..81d4dc659 100644 --- a/library/src/schemas/recursive/recursiveAsync.ts +++ b/library/src/schemas/recursive/recursiveAsync.ts @@ -18,9 +18,7 @@ export type RecursiveSchemaAsync< /** * Creates an async recursive schema. - * * @param getter The schema getter. - * * @returns An async recursive schema. */ export function recursiveAsync< @@ -44,10 +42,8 @@ export function recursiveAsync< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/set/set.ts b/library/src/schemas/set/set.ts index 3e3bbae59..35125fc04 100644 --- a/library/src/schemas/set/set.ts +++ b/library/src/schemas/set/set.ts @@ -20,10 +20,8 @@ export type SetSchema< /** * Creates a set schema. - * * @param value The value schema. * @param pipe A validation and transformation pipe. - * * @returns A set schema. */ export function set( @@ -33,11 +31,9 @@ export function set( /** * Creates a set schema. - * * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A set schema. */ export function set( @@ -46,6 +42,12 @@ export function set( pipe?: Pipe> ): SetSchema; +/** + * + * @param value + * @param arg2 + * @param arg3 + */ export function set( value: TSetValue, arg2?: Pipe> | ErrorMessage, @@ -73,10 +75,8 @@ export function set( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/set/setAsync.ts b/library/src/schemas/set/setAsync.ts index 67fb21fa3..1d89709c4 100644 --- a/library/src/schemas/set/setAsync.ts +++ b/library/src/schemas/set/setAsync.ts @@ -26,10 +26,8 @@ export type SetSchemaAsync< /** * Creates an async set schema. - * * @param value The value schema. * @param pipe A validation and transformation pipe. - * * @returns An async set schema. */ export function setAsync( @@ -39,11 +37,9 @@ export function setAsync( /** * Creates an async set schema. - * * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async set schema. */ export function setAsync( @@ -52,6 +48,12 @@ export function setAsync( pipe?: PipeAsync> ): SetSchemaAsync; +/** + * + * @param value + * @param arg2 + * @param arg3 + */ export function setAsync( value: TSetValue, arg2?: PipeAsync> | ErrorMessage, @@ -79,10 +81,8 @@ export function setAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/special/special.ts b/library/src/schemas/special/special.ts index b7d8057cf..b4d9437dc 100644 --- a/library/src/schemas/special/special.ts +++ b/library/src/schemas/special/special.ts @@ -17,10 +17,8 @@ export type SpecialSchema = BaseSchema< /** * Creates a special schema. - * * @param check The type check function. * @param pipe A validation and transformation pipe. - * * @returns A special schema. */ export function special( @@ -30,11 +28,9 @@ export function special( /** * Creates a special schema. - * * @param check The type check function. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A special schema. */ export function special( @@ -43,6 +39,12 @@ export function special( pipe?: Pipe ): SpecialSchema; +/** + * + * @param check + * @param arg2 + * @param arg3 + */ export function special( check: (input: unknown) => boolean, arg2?: Pipe | ErrorMessage, @@ -65,10 +67,8 @@ export function special( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/special/specialAsync.ts b/library/src/schemas/special/specialAsync.ts index 95c9dc29c..707bff2dd 100644 --- a/library/src/schemas/special/specialAsync.ts +++ b/library/src/schemas/special/specialAsync.ts @@ -17,10 +17,8 @@ export type SpecialSchemaAsync = BaseSchemaAsync< /** * Creates an async special schema. - * * @param check The type check function. * @param pipe A validation and transformation pipe. - * * @returns An async special schema. */ export function specialAsync( @@ -30,11 +28,9 @@ export function specialAsync( /** * Creates a special schema. - * * @param check The type check function. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A special schema. */ export function specialAsync( @@ -43,6 +39,12 @@ export function specialAsync( pipe?: PipeAsync ): SpecialSchemaAsync; +/** + * + * @param check + * @param arg2 + * @param arg3 + */ export function specialAsync( check: (input: unknown) => boolean | Promise, arg2?: PipeAsync | ErrorMessage, @@ -65,10 +67,8 @@ export function specialAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/string/string.ts b/library/src/schemas/string/string.ts index af4348daa..7696f692a 100644 --- a/library/src/schemas/string/string.ts +++ b/library/src/schemas/string/string.ts @@ -14,23 +14,24 @@ export type StringSchema = BaseSchema & { /** * Creates a string schema. - * * @param pipe A validation and transformation pipe. - * * @returns A string schema. */ export function string(pipe?: Pipe): StringSchema; /** * Creates a string schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A string schema. */ export function string(error?: ErrorMessage, pipe?: Pipe): StringSchema; +/** + * + * @param arg1 + * @param arg2 + */ export function string( arg1?: ErrorMessage | Pipe, arg2?: Pipe @@ -52,10 +53,8 @@ export function string( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/string/stringAsync.ts b/library/src/schemas/string/stringAsync.ts index 20a715333..26a7518a6 100644 --- a/library/src/schemas/string/stringAsync.ts +++ b/library/src/schemas/string/stringAsync.ts @@ -17,19 +17,15 @@ export type StringSchemaAsync = BaseSchemaAsync< /** * Creates an async string schema. - * * @param pipe A validation and transformation pipe. - * * @returns An async string schema. */ export function stringAsync(pipe?: PipeAsync): StringSchemaAsync; /** * Creates an async string schema. - * * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async string schema. */ export function stringAsync( @@ -37,6 +33,11 @@ export function stringAsync( pipe?: PipeAsync ): StringSchemaAsync; +/** + * + * @param arg1 + * @param arg2 + */ export function stringAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync @@ -58,10 +59,8 @@ export function stringAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/symbol/symbol.ts b/library/src/schemas/symbol/symbol.ts index 6f4b9c4a3..a396500f6 100644 --- a/library/src/schemas/symbol/symbol.ts +++ b/library/src/schemas/symbol/symbol.ts @@ -10,9 +10,7 @@ export type SymbolSchema = BaseSchema & { /** * Creates a symbol schema. - * * @param error The error message. - * * @returns A symbol schema. */ export function symbol(error?: ErrorMessage): SymbolSchema { @@ -29,10 +27,8 @@ export function symbol(error?: ErrorMessage): SymbolSchema { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/symbol/symbolAsync.ts b/library/src/schemas/symbol/symbolAsync.ts index 2c3487f29..b58ae6c3d 100644 --- a/library/src/schemas/symbol/symbolAsync.ts +++ b/library/src/schemas/symbol/symbolAsync.ts @@ -13,9 +13,7 @@ export type SymbolSchemaAsync = BaseSchemaAsync< /** * Creates an async symbol schema. - * * @param error The error message. - * * @returns An async symbol schema. */ export function symbolAsync(error?: ErrorMessage): SymbolSchemaAsync { @@ -32,10 +30,8 @@ export function symbolAsync(error?: ErrorMessage): SymbolSchemaAsync { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/tuple/tuple.ts b/library/src/schemas/tuple/tuple.ts index ea0b99d46..4caa9f9e3 100644 --- a/library/src/schemas/tuple/tuple.ts +++ b/library/src/schemas/tuple/tuple.ts @@ -22,10 +22,8 @@ export type TupleSchema< /** * Creates a tuple schema. - * * @param items The items schema. * @param pipe A validation and transformation pipe. - * * @returns A tuple schema. */ export function tuple( @@ -35,11 +33,9 @@ export function tuple( /** * Creates a tuple schema. - * * @param items The items schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A tuple schema. */ export function tuple( @@ -50,11 +46,9 @@ export function tuple( /** * Creates a tuple schema. - * * @param items The items schema. * @param rest The rest schema. * @param pipe A validation and transformation pipe. - * * @returns A tuple schema. */ export function tuple< @@ -68,12 +62,10 @@ export function tuple< /** * Creates a tuple schema. - * * @param items The items schema. * @param rest The rest schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns A tuple schema. */ export function tuple< @@ -86,6 +78,13 @@ export function tuple< pipe?: Pipe> ): TupleSchema; +/** + * + * @param items + * @param arg2 + * @param arg3 + * @param arg4 + */ export function tuple< TTupleItems extends TupleShape, TTupleRest extends BaseSchema @@ -120,10 +119,8 @@ export function tuple< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/tuple/tupleAsync.ts b/library/src/schemas/tuple/tupleAsync.ts index dbe2179d7..69fccaecc 100644 --- a/library/src/schemas/tuple/tupleAsync.ts +++ b/library/src/schemas/tuple/tupleAsync.ts @@ -35,10 +35,8 @@ export type TupleSchemaAsync< /** * Creates an async tuple schema. - * * @param items The items schema. * @param pipe A validation and transformation pipe. - * * @returns An async tuple schema. */ export function tupleAsync( @@ -48,11 +46,9 @@ export function tupleAsync( /** * Creates an async tuple schema. - * * @param items The items schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async tuple schema. */ export function tupleAsync( @@ -63,11 +59,9 @@ export function tupleAsync( /** * Creates an async tuple schema. - * * @param items The items schema. * @param rest The rest schema. * @param pipe A validation and transformation pipe. - * * @returns An async tuple schema. */ export function tupleAsync< @@ -81,12 +75,10 @@ export function tupleAsync< /** * Creates an async tuple schema. - * * @param items The items schema. * @param rest The rest schema. * @param error The error message. * @param pipe A validation and transformation pipe. - * * @returns An async tuple schema. */ export function tupleAsync< @@ -99,6 +91,13 @@ export function tupleAsync< pipe?: PipeAsync> ): TupleSchemaAsync; +/** + * + * @param items + * @param arg2 + * @param arg3 + * @param arg4 + */ export function tupleAsync< TTupleItems extends TupleShapeAsync, TTupleRest extends BaseSchema | BaseSchemaAsync | undefined @@ -136,10 +135,8 @@ export function tupleAsync< /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/tuple/utils/getTupleArgs/getTupleArgs.ts b/library/src/schemas/tuple/utils/getTupleArgs/getTupleArgs.ts index 608a642a9..90c7263c2 100644 --- a/library/src/schemas/tuple/utils/getTupleArgs/getTupleArgs.ts +++ b/library/src/schemas/tuple/utils/getTupleArgs/getTupleArgs.ts @@ -9,11 +9,9 @@ import { getDefaultArgs } from '../../../../utils/index.ts'; /** * Returns rest, error and pipe from dynamic arguments. - * * @param arg1 First argument. * @param arg2 Second argument. * @param arg3 Third argument. - * * @returns The tuple arguments. */ export function getTupleArgs< diff --git a/library/src/schemas/undefinedType/undefinedType.ts b/library/src/schemas/undefinedType/undefinedType.ts index 65277e26a..cd6e94671 100644 --- a/library/src/schemas/undefinedType/undefinedType.ts +++ b/library/src/schemas/undefinedType/undefinedType.ts @@ -13,9 +13,7 @@ export type UndefinedSchema = BaseSchema< /** * Creates a undefined schema. - * * @param error The error message. - * * @returns A undefined schema. */ export function undefinedType(error?: ErrorMessage): UndefinedSchema { @@ -32,10 +30,8 @@ export function undefinedType(error?: ErrorMessage): UndefinedSchema { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/undefinedType/undefinedTypeAsync.ts b/library/src/schemas/undefinedType/undefinedTypeAsync.ts index da4b40b15..3167c8224 100644 --- a/library/src/schemas/undefinedType/undefinedTypeAsync.ts +++ b/library/src/schemas/undefinedType/undefinedTypeAsync.ts @@ -13,9 +13,7 @@ export type UndefinedSchemaAsync = BaseSchemaAsync< /** * Creates an async undefined schema. - * * @param error The error message. - * * @returns An async undefined schema. */ export function undefinedTypeAsync(error?: ErrorMessage): UndefinedSchemaAsync { @@ -32,10 +30,8 @@ export function undefinedTypeAsync(error?: ErrorMessage): UndefinedSchemaAsync { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/union/union.ts b/library/src/schemas/union/union.ts index 45d814f6a..0c8f96a43 100644 --- a/library/src/schemas/union/union.ts +++ b/library/src/schemas/union/union.ts @@ -29,10 +29,8 @@ export type UnionSchema< /** * Creates a union schema. - * * @param union The union schema. * @param error The error message. - * * @returns A union schema. */ export function union( @@ -57,10 +55,8 @@ export function union( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/union/unionAsync.ts b/library/src/schemas/union/unionAsync.ts index 3a591db42..19d02416f 100644 --- a/library/src/schemas/union/unionAsync.ts +++ b/library/src/schemas/union/unionAsync.ts @@ -30,10 +30,8 @@ export type UnionSchemaAsync< /** * Creates an async union schema. - * * @param union The union schema. * @param error The error message. - * * @returns An async union schema. */ export function unionAsync( @@ -58,10 +56,8 @@ export function unionAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/unknown/unknown.ts b/library/src/schemas/unknown/unknown.ts index 4bc76fdf1..e523caa38 100644 --- a/library/src/schemas/unknown/unknown.ts +++ b/library/src/schemas/unknown/unknown.ts @@ -10,9 +10,7 @@ export type UnknownSchema = BaseSchema & { /** * Creates a unknown schema. - * * @param pipe A validation and transformation pipe. - * * @returns A unknown schema. */ export function unknown(pipe: Pipe = []): UnknownSchema { @@ -29,10 +27,8 @@ export function unknown(pipe: Pipe = []): UnknownSchema { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/unknown/unknownAsync.ts b/library/src/schemas/unknown/unknownAsync.ts index 375b20ea2..f91593279 100644 --- a/library/src/schemas/unknown/unknownAsync.ts +++ b/library/src/schemas/unknown/unknownAsync.ts @@ -13,9 +13,7 @@ export type UnknownSchemaAsync = BaseSchemaAsync< /** * Creates an async unknown schema. - * * @param pipe A validation and transformation pipe. - * * @returns An async unknown schema. */ export function unknownAsync( @@ -34,10 +32,8 @@ export function unknownAsync( /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/voidType/voidType.ts b/library/src/schemas/voidType/voidType.ts index 6f95474a6..a3e178f96 100644 --- a/library/src/schemas/voidType/voidType.ts +++ b/library/src/schemas/voidType/voidType.ts @@ -10,9 +10,7 @@ export type VoidSchema = BaseSchema & { /** * Creates a void schema. - * * @param error The error message. - * * @returns A void schema. */ export function voidType(error?: ErrorMessage): VoidSchema { @@ -29,10 +27,8 @@ export function voidType(error?: ErrorMessage): VoidSchema { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/voidType/voidTypeAsync.ts b/library/src/schemas/voidType/voidTypeAsync.ts index e894afc9a..a408d6b51 100644 --- a/library/src/schemas/voidType/voidTypeAsync.ts +++ b/library/src/schemas/voidType/voidTypeAsync.ts @@ -10,9 +10,7 @@ export type VoidSchemaAsync = BaseSchemaAsync & { /** * Creates an async void schema. - * * @param error The error message. - * * @returns An async void schema. */ export function voidTypeAsync(error?: ErrorMessage): VoidSchemaAsync { @@ -29,10 +27,8 @@ export function voidTypeAsync(error?: ErrorMessage): VoidSchemaAsync { /** * Parses unknown input based on its schema. - * * @param input The input to be parsed. * @param info The parse info. - * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/transformations/toCustom/toCustom.ts b/library/src/transformations/toCustom/toCustom.ts index 1e8120e4c..52647e862 100644 --- a/library/src/transformations/toCustom/toCustom.ts +++ b/library/src/transformations/toCustom/toCustom.ts @@ -3,9 +3,7 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates a custom transformation function. - * * @param action The transform action. - * * @returns A transformation function. */ export function toCustom(action: (input: TInput) => TInput) { diff --git a/library/src/transformations/toCustom/toCustomAsync.ts b/library/src/transformations/toCustom/toCustomAsync.ts index 476e3ed0d..5e1aa221f 100644 --- a/library/src/transformations/toCustom/toCustomAsync.ts +++ b/library/src/transformations/toCustom/toCustomAsync.ts @@ -2,9 +2,7 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a async custom transformation function. - * * @param action The transform action. - * * @returns A async transformation function. */ export function toCustomAsync( diff --git a/library/src/transformations/toLowerCase/toLowerCase.ts b/library/src/transformations/toLowerCase/toLowerCase.ts index 01494600c..8b80fd9e3 100644 --- a/library/src/transformations/toLowerCase/toLowerCase.ts +++ b/library/src/transformations/toLowerCase/toLowerCase.ts @@ -3,7 +3,6 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a transformation function that converts all the alphabetic * characters in a string to lowercase. - * * @returns A transformation function. */ export function toLowerCase() { diff --git a/library/src/transformations/toMaxValue/toMaxValue.ts b/library/src/transformations/toMaxValue/toMaxValue.ts index e60321a57..8e96c0357 100644 --- a/library/src/transformations/toMaxValue/toMaxValue.ts +++ b/library/src/transformations/toMaxValue/toMaxValue.ts @@ -3,9 +3,7 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a transformation function that sets a string, number or date to a * maximum value. - * * @param requirement The maximum value. - * * @returns A transformation function. */ export function toMaxValue< diff --git a/library/src/transformations/toMinValue/toMinValue.ts b/library/src/transformations/toMinValue/toMinValue.ts index 674db8f52..4bc1b1f31 100644 --- a/library/src/transformations/toMinValue/toMinValue.ts +++ b/library/src/transformations/toMinValue/toMinValue.ts @@ -3,9 +3,7 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a transformation function that sets a string, number or date to a * minimum value. - * * @param requirement The minimum value. - * * @returns A transformation function. */ export function toMinValue< diff --git a/library/src/transformations/toTrimmed/toTrimmed.ts b/library/src/transformations/toTrimmed/toTrimmed.ts index 4e54c5c7e..c54eccaf5 100644 --- a/library/src/transformations/toTrimmed/toTrimmed.ts +++ b/library/src/transformations/toTrimmed/toTrimmed.ts @@ -4,7 +4,6 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates a transformation function that removes the leading and trailing * white space and line terminator characters from a string. - * * @returns A transformation function. */ export function toTrimmed() { diff --git a/library/src/transformations/toTrimmedEnd/toTrimmedEnd.ts b/library/src/transformations/toTrimmedEnd/toTrimmedEnd.ts index ed2eaad65..a976777dd 100644 --- a/library/src/transformations/toTrimmedEnd/toTrimmedEnd.ts +++ b/library/src/transformations/toTrimmedEnd/toTrimmedEnd.ts @@ -4,7 +4,6 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates a transformation function that removes the trailing white space and * line terminator characters from a string. - * * @returns A transformation function. */ export function toTrimmedEnd() { diff --git a/library/src/transformations/toTrimmedStart/toTrimmedStart.ts b/library/src/transformations/toTrimmedStart/toTrimmedStart.ts index 8e264aa2d..dd8689c2f 100644 --- a/library/src/transformations/toTrimmedStart/toTrimmedStart.ts +++ b/library/src/transformations/toTrimmedStart/toTrimmedStart.ts @@ -3,7 +3,6 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a transformation function that removes the leading white space and * line terminator characters from a string. - * * @returns A transformation function. */ export function toTrimmedStart() { diff --git a/library/src/transformations/toUpperCase/toUpperCase.ts b/library/src/transformations/toUpperCase/toUpperCase.ts index aa431dee0..ade6cfef8 100644 --- a/library/src/transformations/toUpperCase/toUpperCase.ts +++ b/library/src/transformations/toUpperCase/toUpperCase.ts @@ -3,7 +3,6 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a transformation function that converts all the alphabetic * characters in a string to uppercase. - * * @returns A transformation function. */ export function toUpperCase() { diff --git a/library/src/utils/executePipe/executePipe.ts b/library/src/utils/executePipe/executePipe.ts index ad8d2bfad..0afa3978e 100644 --- a/library/src/utils/executePipe/executePipe.ts +++ b/library/src/utils/executePipe/executePipe.ts @@ -12,11 +12,11 @@ import { getIssue, getPipeInfo } from './utils/index.ts'; /** * Executes the validation and transformation pipe. - * * @param input The input value. * @param pipe The pipe to be executed. * @param info The validation info. - * + * @param parseInfo + * @param reason * @returns The output value. */ export function executePipe( diff --git a/library/src/utils/executePipe/executePipeAsync.ts b/library/src/utils/executePipe/executePipeAsync.ts index 31d05a50e..1d1fd5a9c 100644 --- a/library/src/utils/executePipe/executePipeAsync.ts +++ b/library/src/utils/executePipe/executePipeAsync.ts @@ -12,11 +12,11 @@ import { getIssue, getPipeInfo } from './utils/index.ts'; /** * Executes the async validation and transformation pipe. - * * @param input The input value. * @param pipe The pipe to be executed. * @param info The validation info. - * + * @param parseInfo + * @param reason * @returns The output value. */ export async function executePipeAsync( diff --git a/library/src/utils/executePipe/utils/getIssue/getIssue.ts b/library/src/utils/executePipe/utils/getIssue/getIssue.ts index e8d1f4751..0d56e308b 100644 --- a/library/src/utils/executePipe/utils/getIssue/getIssue.ts +++ b/library/src/utils/executePipe/utils/getIssue/getIssue.ts @@ -2,10 +2,8 @@ import type { Issue, PipeInfo } from '../../../../types.ts'; /** * Returns the final issue data. - * * @param info The pipe info. * @param issue The issue data. - * * @returns The issue data. */ export function getIssue( diff --git a/library/src/utils/executePipe/utils/getPipeInfo/getPipeInfo.ts b/library/src/utils/executePipe/utils/getPipeInfo/getPipeInfo.ts index 6fdb9c2f0..3927685c9 100644 --- a/library/src/utils/executePipe/utils/getPipeInfo/getPipeInfo.ts +++ b/library/src/utils/executePipe/utils/getPipeInfo/getPipeInfo.ts @@ -2,10 +2,8 @@ import type { IssueReason, ParseInfo, PipeInfo } from '../../../../types.ts'; /** * Returns the pipe info. - * * @param info The parse info. * @param reason The issue reason. - * * @returns The pipe info. */ export function getPipeInfo( diff --git a/library/src/utils/getDefaultArgs/getDefaultArgs.ts b/library/src/utils/getDefaultArgs/getDefaultArgs.ts index 74d5b7584..c6d456fe4 100644 --- a/library/src/utils/getDefaultArgs/getDefaultArgs.ts +++ b/library/src/utils/getDefaultArgs/getDefaultArgs.ts @@ -2,10 +2,8 @@ import type { ErrorMessage, Pipe, PipeAsync } from '../../types.ts'; /** * Returns error and pipe from dynamic arguments. - * * @param arg1 First argument. * @param arg2 Second argument. - * * @returns The default arguments. */ export function getDefaultArgs | PipeAsync>( diff --git a/library/src/utils/getErrorMessage/getErrorMessage.ts b/library/src/utils/getErrorMessage/getErrorMessage.ts index 6c6d67ee8..0ad6e41a3 100644 --- a/library/src/utils/getErrorMessage/getErrorMessage.ts +++ b/library/src/utils/getErrorMessage/getErrorMessage.ts @@ -2,9 +2,7 @@ import type { ErrorMessage } from '../../types.ts'; /** * Returns the final string of the error message. - * * @param error The error message. - * * @returns The error message. */ export function getErrorMessage(error: ErrorMessage): string { diff --git a/library/src/utils/getIssues/getIssues.ts b/library/src/utils/getIssues/getIssues.ts index 0fba2b18d..ef6f32f52 100644 --- a/library/src/utils/getIssues/getIssues.ts +++ b/library/src/utils/getIssues/getIssues.ts @@ -1,8 +1,6 @@ /** * Returns the result object with issues. - * * @param issues The issues. - * * @returns The result object. */ export function getIssues(issues: TIssues): { issues: TIssues } { diff --git a/library/src/utils/getOutput/getOutput.ts b/library/src/utils/getOutput/getOutput.ts index ce9ecb2b3..822a03b4c 100644 --- a/library/src/utils/getOutput/getOutput.ts +++ b/library/src/utils/getOutput/getOutput.ts @@ -1,8 +1,6 @@ /** * Returns the result object with an output. - * * @param output The output value. - * * @returns The result object. */ export function getOutput(output: TOutput): { output: TOutput } { diff --git a/library/src/utils/getPipeIssues/getPipeIssues.ts b/library/src/utils/getPipeIssues/getPipeIssues.ts index 711d7905b..ebaf5f359 100644 --- a/library/src/utils/getPipeIssues/getPipeIssues.ts +++ b/library/src/utils/getPipeIssues/getPipeIssues.ts @@ -4,11 +4,9 @@ import { getIssues } from '../getIssues/getIssues.ts'; /** * Returns the pipeline result object with issues. - * * @param validation The validation name. * @param error The error message. * @param input The input value. - * * @returns The pipeline result object. */ export function getPipeIssues( diff --git a/library/src/utils/getSchemaIssues/getSchemaIssues.ts b/library/src/utils/getSchemaIssues/getSchemaIssues.ts index 2a7aae459..b99e1229e 100644 --- a/library/src/utils/getSchemaIssues/getSchemaIssues.ts +++ b/library/src/utils/getSchemaIssues/getSchemaIssues.ts @@ -8,14 +8,12 @@ import { getErrorMessage } from '../getErrorMessage/getErrorMessage.ts'; /** * Returns the schema result object with issues. - * * @param info The parse info. * @param reason The issue reason. * @param validation The validation name. * @param error The error message. * @param input The input value. * @param issues The sub issues. - * * @returns The schema result object. */ export function getSchemaIssues( diff --git a/library/src/utils/isLuhnAlgo/isLuhnAlgo.ts b/library/src/utils/isLuhnAlgo/isLuhnAlgo.ts index 95da980be..c4f4d4fa6 100644 --- a/library/src/utils/isLuhnAlgo/isLuhnAlgo.ts +++ b/library/src/utils/isLuhnAlgo/isLuhnAlgo.ts @@ -1,8 +1,6 @@ /** * Checks whether a string with numbers corresponds to the luhn algorithm. - * * @param input The input to be checked. - * * @returns Whether input is valid. */ export function isLuhnAlgo(input: string) { diff --git a/library/src/validations/bytes/bytes.ts b/library/src/validations/bytes/bytes.ts index ddedf0b07..e0d381e0c 100644 --- a/library/src/validations/bytes/bytes.ts +++ b/library/src/validations/bytes/bytes.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the byte length of a string. - * * @param requirement The byte length. * @param error The error message. - * * @returns A validation function. */ export function bytes( diff --git a/library/src/validations/cuid2/cuid2.ts b/library/src/validations/cuid2/cuid2.ts index 0e30229f0..c0d8a5217 100644 --- a/library/src/validations/cuid2/cuid2.ts +++ b/library/src/validations/cuid2/cuid2.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates a [cuid2](https://github.com/paralleldrive/cuid2#cuid2). - * * @param error The error message. - * * @returns A validation function. */ export function cuid2(error?: ErrorMessage) { diff --git a/library/src/validations/custom/custom.ts b/library/src/validations/custom/custom.ts index faa5e6800..80e246a1a 100644 --- a/library/src/validations/custom/custom.ts +++ b/library/src/validations/custom/custom.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a custom validation function. - * * @param requirement The validation function. * @param error The error message. - * * @returns A validation function. */ export function custom( diff --git a/library/src/validations/custom/customAsync.ts b/library/src/validations/custom/customAsync.ts index 7b8047473..ead0a9dcb 100644 --- a/library/src/validations/custom/customAsync.ts +++ b/library/src/validations/custom/customAsync.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a async custom validation function. - * * @param requirement The async validation function. * @param error The error message. - * * @returns A async validation function. */ export function customAsync( diff --git a/library/src/validations/email/email.ts b/library/src/validations/email/email.ts index 0a541ad22..31fe04c05 100644 --- a/library/src/validations/email/email.ts +++ b/library/src/validations/email/email.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates an email. - * * @param error The error message. - * * @returns A validation function. */ export function email(error?: ErrorMessage) { diff --git a/library/src/validations/emoji/emoji.ts b/library/src/validations/emoji/emoji.ts index 83ade0a6b..6d9addac6 100644 --- a/library/src/validations/emoji/emoji.ts +++ b/library/src/validations/emoji/emoji.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates an emoji. - * * @param error The error message. - * * @returns A validation function. */ export function emoji(error?: ErrorMessage) { diff --git a/library/src/validations/endsWith/endsWith.ts b/library/src/validations/endsWith/endsWith.ts index 7b85ac066..1b5d83843 100644 --- a/library/src/validations/endsWith/endsWith.ts +++ b/library/src/validations/endsWith/endsWith.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the end of a string. - * * @param requirement The end string. * @param error The error message. - * * @returns A validation function. */ export function endsWith( diff --git a/library/src/validations/equal/equal.ts b/library/src/validations/equal/equal.ts index 80c140c06..0e1881ec5 100644 --- a/library/src/validations/equal/equal.ts +++ b/library/src/validations/equal/equal.ts @@ -3,12 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that checks the value for equality. - * * @deprecated Function has been renamed to `value`. - * * @param requirement The required value. * @param error The error message. - * * @returns A validation function. */ export function equal< diff --git a/library/src/validations/excludes/excludes.ts b/library/src/validations/excludes/excludes.ts index a20140d78..8ffe0bd04 100644 --- a/library/src/validations/excludes/excludes.ts +++ b/library/src/validations/excludes/excludes.ts @@ -13,10 +13,8 @@ export function excludes( /** * Creates a validation function that validates the content of a string or array. - * * @param requirement The content to be excluded. * @param error The error message. - * * @returns A validation function. */ export function excludes( diff --git a/library/src/validations/finite/finite.ts b/library/src/validations/finite/finite.ts index 01c68f390..158ae843c 100644 --- a/library/src/validations/finite/finite.ts +++ b/library/src/validations/finite/finite.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates whether a number is finite. - * * @param error The error message. - * * @returns A validation function. */ export function finite(error?: ErrorMessage) { diff --git a/library/src/validations/imei/imei.ts b/library/src/validations/imei/imei.ts index 47ea6718c..254de3f04 100644 --- a/library/src/validations/imei/imei.ts +++ b/library/src/validations/imei/imei.ts @@ -5,9 +5,7 @@ import { getOutput, getPipeIssues, isLuhnAlgo } from '../../utils/index.ts'; * Creates a validation function that validates an IMEI. * * Format: AA-BBBBBB-CCCCCC-D - * * @param error The error message. - * * @returns A validation function. */ export function imei(error?: ErrorMessage) { diff --git a/library/src/validations/includes/includes.ts b/library/src/validations/includes/includes.ts index f8dd720ae..d0149cc15 100644 --- a/library/src/validations/includes/includes.ts +++ b/library/src/validations/includes/includes.ts @@ -13,10 +13,8 @@ export function includes( /** * Creates a validation function that validates the content of a string or array. - * * @param requirement The content to be included. * @param error The error message. - * * @returns A validation function. */ export function includes( diff --git a/library/src/validations/integer/integer.ts b/library/src/validations/integer/integer.ts index 10c4746c6..90544ab1b 100644 --- a/library/src/validations/integer/integer.ts +++ b/library/src/validations/integer/integer.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates whether a number is an integer. - * * @param error The error message. - * * @returns A validation function. */ export function integer(error?: ErrorMessage) { diff --git a/library/src/validations/ip/ip.ts b/library/src/validations/ip/ip.ts index a72efd5c0..dd5f68bd1 100644 --- a/library/src/validations/ip/ip.ts +++ b/library/src/validations/ip/ip.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates an IP v4 or v6 address. - * * @param error The error message. - * * @returns A validation function. */ export function ip(error?: ErrorMessage) { diff --git a/library/src/validations/ipv4/ipv4.ts b/library/src/validations/ipv4/ipv4.ts index 4559c3178..678da0fc0 100644 --- a/library/src/validations/ipv4/ipv4.ts +++ b/library/src/validations/ipv4/ipv4.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates an IP v4 address. - * * @param error The error message. - * * @returns A validation function. */ export function ipv4(error?: ErrorMessage) { diff --git a/library/src/validations/ipv6/ipv6.ts b/library/src/validations/ipv6/ipv6.ts index 5f15e97e3..bc0589ae1 100644 --- a/library/src/validations/ipv6/ipv6.ts +++ b/library/src/validations/ipv6/ipv6.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates an IP v6 address. - * * @param error The error message. - * * @returns A validation function. */ export function ipv6(error?: ErrorMessage) { diff --git a/library/src/validations/isoDate/isoDate.ts b/library/src/validations/isoDate/isoDate.ts index 83a37402d..72a281478 100644 --- a/library/src/validations/isoDate/isoDate.ts +++ b/library/src/validations/isoDate/isoDate.ts @@ -9,9 +9,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Hint: The regex used cannot validate the maximum number of days based on * year and month. For example, "2023-06-31" is valid although June has only * 30 days. - * * @param error The error message. - * * @returns A validation function. */ export function isoDate(error?: ErrorMessage) { diff --git a/library/src/validations/isoDateTime/isoDateTime.ts b/library/src/validations/isoDateTime/isoDateTime.ts index 5fe6081be..7c6983bcb 100644 --- a/library/src/validations/isoDateTime/isoDateTime.ts +++ b/library/src/validations/isoDateTime/isoDateTime.ts @@ -9,9 +9,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Hint: The regex used cannot validate the maximum number of days based on * year and month. For example, "2023-06-31T00:00" is valid although June has only * 30 days. - * * @param error The error message. - * * @returns A validation function. */ export function isoDateTime(error?: ErrorMessage) { diff --git a/library/src/validations/isoTime/isoTime.ts b/library/src/validations/isoTime/isoTime.ts index 68a0bc977..7d539a161 100644 --- a/library/src/validations/isoTime/isoTime.ts +++ b/library/src/validations/isoTime/isoTime.ts @@ -5,9 +5,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Creates a validation function that validates a time. * * Format: hh:mm - * * @param error The error message. - * * @returns A validation function. */ export function isoTime(error?: ErrorMessage) { diff --git a/library/src/validations/isoTimeSecond/isoTimeSecond.ts b/library/src/validations/isoTimeSecond/isoTimeSecond.ts index b65f66a3e..4cb180aff 100644 --- a/library/src/validations/isoTimeSecond/isoTimeSecond.ts +++ b/library/src/validations/isoTimeSecond/isoTimeSecond.ts @@ -5,9 +5,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Creates a validation function that validates a time with seconds. * * Format: hh:mm:ss - * * @param error The error message. - * * @returns A validation function. */ export function isoTimeSecond(error?: ErrorMessage) { diff --git a/library/src/validations/isoTimestamp/isoTimestamp.ts b/library/src/validations/isoTimestamp/isoTimestamp.ts index 10773d75c..bd3d7051a 100644 --- a/library/src/validations/isoTimestamp/isoTimestamp.ts +++ b/library/src/validations/isoTimestamp/isoTimestamp.ts @@ -9,9 +9,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Hint: The regex used cannot validate the maximum number of days based on * year and month. For example, "2023-06-31T00:00:00.000Z" is valid although * June has only 30 days. - * * @param error The error message. - * * @returns A validation function. */ export function isoTimestamp(error?: ErrorMessage) { diff --git a/library/src/validations/isoWeek/isoWeek.ts b/library/src/validations/isoWeek/isoWeek.ts index 222096c57..c5803f836 100644 --- a/library/src/validations/isoWeek/isoWeek.ts +++ b/library/src/validations/isoWeek/isoWeek.ts @@ -9,9 +9,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Hint: The regex used cannot validate the maximum number of weeks based on * the year. For example, "2021W53" is valid even though the year 2021 has only * 52 weeks. - * * @param error The error message. - * * @returns A validation function. */ export function isoWeek(error?: ErrorMessage) { diff --git a/library/src/validations/length/length.ts b/library/src/validations/length/length.ts index 4456276de..1e8ed0f2f 100644 --- a/library/src/validations/length/length.ts +++ b/library/src/validations/length/length.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the length of a string or array. - * * @param requirement The length. * @param error The error message. - * * @returns A validation function. */ export function length( diff --git a/library/src/validations/maxBytes/maxBytes.ts b/library/src/validations/maxBytes/maxBytes.ts index fd3d27c54..dbb18e255 100644 --- a/library/src/validations/maxBytes/maxBytes.ts +++ b/library/src/validations/maxBytes/maxBytes.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the byte length of a string. - * * @param requirement The maximum length in byte. * @param error The error message. - * * @returns A validation function. */ export function maxBytes( diff --git a/library/src/validations/maxLength/maxLength.ts b/library/src/validations/maxLength/maxLength.ts index 2fd50ae1c..fd9f47726 100644 --- a/library/src/validations/maxLength/maxLength.ts +++ b/library/src/validations/maxLength/maxLength.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the length of a string or array. - * * @param requirement The maximum length. * @param error The error message. - * * @returns A validation function. */ export function maxLength( diff --git a/library/src/validations/maxSize/maxSize.ts b/library/src/validations/maxSize/maxSize.ts index 7909043ac..2fc76faca 100644 --- a/library/src/validations/maxSize/maxSize.ts +++ b/library/src/validations/maxSize/maxSize.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the size of a map, set or blob. - * * @param requirement The maximum size. * @param error The error message. - * * @returns A validation function. */ export function maxSize | Set | Blob>( diff --git a/library/src/validations/maxValue/maxValue.ts b/library/src/validations/maxValue/maxValue.ts index 5d3374f82..9db1410f7 100644 --- a/library/src/validations/maxValue/maxValue.ts +++ b/library/src/validations/maxValue/maxValue.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the value of a string, number or date. - * * @param requirement The maximum value. * @param error The error message. - * * @returns A validation function. */ export function maxValue< @@ -21,7 +19,6 @@ export function maxValue< /** * See {@link maxValue} - * * @deprecated Function has been renamed to `maxValue`. */ export const maxRange = maxValue; diff --git a/library/src/validations/mimeType/mimeType.ts b/library/src/validations/mimeType/mimeType.ts index 37ac54076..feb50e08e 100644 --- a/library/src/validations/mimeType/mimeType.ts +++ b/library/src/validations/mimeType/mimeType.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the MIME type of a file. - * * @param requirement The MIME types. * @param error The error message. - * * @returns A validation function. */ export function mimeType( diff --git a/library/src/validations/minBytes/minBytes.ts b/library/src/validations/minBytes/minBytes.ts index 3aa80d392..c136b7931 100644 --- a/library/src/validations/minBytes/minBytes.ts +++ b/library/src/validations/minBytes/minBytes.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the byte length of a string. - * * @param requirement The minimum length in byte. * @param error The error message. - * * @returns A validation function. */ export function minBytes( diff --git a/library/src/validations/minLength/minLength.ts b/library/src/validations/minLength/minLength.ts index 5945d06bb..326e46d22 100644 --- a/library/src/validations/minLength/minLength.ts +++ b/library/src/validations/minLength/minLength.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the length of a string or array. - * * @param requirement The minimum length. * @param error The error message. - * * @returns A validation function. */ export function minLength( diff --git a/library/src/validations/minSize/minSize.ts b/library/src/validations/minSize/minSize.ts index 90d88f4f0..4e6c8425b 100644 --- a/library/src/validations/minSize/minSize.ts +++ b/library/src/validations/minSize/minSize.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the size of a map, set or blob. - * * @param requirement The minimum size. * @param error The error message. - * * @returns A validation function. */ export function minSize | Set | Blob>( diff --git a/library/src/validations/minValue/minValue.ts b/library/src/validations/minValue/minValue.ts index 783acfc26..2e4dc5eb1 100644 --- a/library/src/validations/minValue/minValue.ts +++ b/library/src/validations/minValue/minValue.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the value of a string, number or date. - * * @param requirement The minimum value. * @param error The error message. - * * @returns A validation function. */ export function minValue< @@ -21,7 +19,6 @@ export function minValue< /** * See {@link minValue} - * * @deprecated Function has been renamed to `minValue`. */ export const minRange = minValue; diff --git a/library/src/validations/multipleOf/multipleOf.ts b/library/src/validations/multipleOf/multipleOf.ts index 7f3fd7679..114fa4d06 100644 --- a/library/src/validations/multipleOf/multipleOf.ts +++ b/library/src/validations/multipleOf/multipleOf.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates whether a number is a multiple. - * * @param requirement The divisor. * @param error The error message. - * * @returns A validation function. */ export function multipleOf( diff --git a/library/src/validations/notBytes/notBytes.ts b/library/src/validations/notBytes/notBytes.ts index c681537f0..545ebcb06 100644 --- a/library/src/validations/notBytes/notBytes.ts +++ b/library/src/validations/notBytes/notBytes.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the byte length of a string. - * * @param requirement The byte length. * @param error The error message. - * * @returns A validation function. */ export function notBytes( diff --git a/library/src/validations/notLength/notLength.ts b/library/src/validations/notLength/notLength.ts index f69decc22..370c8cbf9 100644 --- a/library/src/validations/notLength/notLength.ts +++ b/library/src/validations/notLength/notLength.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the length of a string or array. - * * @param requirement The length. * @param error The error message. - * * @returns A validation function. */ export function notLength( diff --git a/library/src/validations/notSize/notSize.ts b/library/src/validations/notSize/notSize.ts index 19340db8e..076a87c18 100644 --- a/library/src/validations/notSize/notSize.ts +++ b/library/src/validations/notSize/notSize.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the size of a map, set or blob. - * * @param requirement The size. * @param error The error message. - * * @returns A validation function. */ export function notSize | Set | Blob>( diff --git a/library/src/validations/notValue/notValue.ts b/library/src/validations/notValue/notValue.ts index 9f7646f40..13dcd9d21 100644 --- a/library/src/validations/notValue/notValue.ts +++ b/library/src/validations/notValue/notValue.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the value of a string or number. - * * @param requirement The value. * @param error The error message. - * * @returns A validation function. */ export function notValue< diff --git a/library/src/validations/regex/regex.ts b/library/src/validations/regex/regex.ts index f8ca829da..fd191e66b 100644 --- a/library/src/validations/regex/regex.ts +++ b/library/src/validations/regex/regex.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates a string with a regex. - * * @param requirement The regex pattern. * @param error The error message. - * * @returns A validation function. */ export function regex( diff --git a/library/src/validations/safeInteger/safeInteger.ts b/library/src/validations/safeInteger/safeInteger.ts index 0cc3e2776..c8fb98e55 100644 --- a/library/src/validations/safeInteger/safeInteger.ts +++ b/library/src/validations/safeInteger/safeInteger.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates whether a number is a safe integer. - * * @param error The error message. - * * @returns A validation function. */ export function safeInteger(error?: ErrorMessage) { diff --git a/library/src/validations/size/size.ts b/library/src/validations/size/size.ts index 87d53d357..d334a2c6a 100644 --- a/library/src/validations/size/size.ts +++ b/library/src/validations/size/size.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the size of a map, set or blob. - * * @param requirement The size. * @param error The error message. - * * @returns A validation function. */ export function size | Set | Blob>( diff --git a/library/src/validations/startsWith/startsWith.ts b/library/src/validations/startsWith/startsWith.ts index b9dca2475..4bd780c16 100644 --- a/library/src/validations/startsWith/startsWith.ts +++ b/library/src/validations/startsWith/startsWith.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the start of a string. - * * @param requirement The start string. * @param error The error message. - * * @returns A validation function. */ export function startsWith( diff --git a/library/src/validations/ulid/ulid.ts b/library/src/validations/ulid/ulid.ts index 395470f20..bc4290854 100644 --- a/library/src/validations/ulid/ulid.ts +++ b/library/src/validations/ulid/ulid.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates a [ULID](https://github.com/ulid/spec). - * * @param error The error message. - * * @returns A validation function. */ export function ulid(error?: ErrorMessage) { diff --git a/library/src/validations/url/url.ts b/library/src/validations/url/url.ts index f3a4081cb..807a81ae1 100644 --- a/library/src/validations/url/url.ts +++ b/library/src/validations/url/url.ts @@ -6,9 +6,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * * Hint: The value is passed to the URL constructor to check if it is valid. * This check is not perfect. For example, values like "abc:1234" are accepted. - * * @param error The error message. - * * @returns A validation function. */ export function url(error?: ErrorMessage) { diff --git a/library/src/validations/uuid/uuid.ts b/library/src/validations/uuid/uuid.ts index 9e683705c..b75ce1fca 100644 --- a/library/src/validations/uuid/uuid.ts +++ b/library/src/validations/uuid/uuid.ts @@ -3,9 +3,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates a UUID. - * * @param error The error message. - * * @returns A validation function. */ export function uuid(error?: ErrorMessage) { diff --git a/library/src/validations/value/value.ts b/library/src/validations/value/value.ts index 611bed68a..41db4b3a8 100644 --- a/library/src/validations/value/value.ts +++ b/library/src/validations/value/value.ts @@ -3,10 +3,8 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the value of a string or number. - * * @param requirement The value. * @param error The error message. - * * @returns A validation function. */ export function value< From 6ab6a9a4e6b9ba25cba3563f6cc36ac8218ed9ee Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Sun, 8 Oct 2023 16:22:07 +0900 Subject: [PATCH 03/13] chore: fixes by hand --- library/src/error/flatten/flatten.ts | 3 ++- library/src/methods/brand/brand.ts | 5 ++--- library/src/methods/merge/merge.ts | 8 ++++---- library/src/methods/merge/mergeAsync.ts | 7 ++++--- library/src/methods/omit/omit.ts | 9 +++++---- library/src/methods/omit/omitAsync.ts | 9 +++++---- library/src/methods/partial/partial.ts | 7 ++++--- library/src/methods/partial/partialAsync.ts | 7 ++++--- library/src/methods/pick/pick.ts | 9 +++++---- library/src/methods/pick/pickAsync.ts | 9 +++++---- library/src/methods/required/required.ts | 7 ++++--- library/src/methods/required/requiredAsync.ts | 8 ++++---- library/src/schemas/array/array.ts | 8 ++++---- library/src/schemas/array/arrayAsync.ts | 8 ++++---- library/src/schemas/bigint/bigint.ts | 6 +++--- library/src/schemas/bigint/bigintAsync.ts | 6 +++--- library/src/schemas/blob/blob.ts | 6 +++--- library/src/schemas/blob/blobAsync.ts | 6 +++--- library/src/schemas/boolean/boolean.ts | 6 +++--- library/src/schemas/boolean/booleanAsync.ts | 6 +++--- library/src/schemas/date/date.ts | 6 +++--- library/src/schemas/date/dateAsync.ts | 6 +++--- library/src/schemas/instance/instance.ts | 8 ++++---- library/src/schemas/instance/instanceAsync.ts | 8 ++++---- library/src/schemas/map/map.ts | 10 +++++----- library/src/schemas/map/mapAsync.ts | 10 +++++----- library/src/schemas/nullable/nullable.ts | 1 + library/src/schemas/nullable/nullableAsync.ts | 1 + library/src/schemas/nullish/nullish.ts | 1 + library/src/schemas/nullish/nullishAsync.ts | 1 + library/src/schemas/number/number.ts | 6 +++--- library/src/schemas/number/numberAsync.ts | 6 +++--- library/src/schemas/object/object.ts | 8 ++++---- library/src/schemas/object/objectAsync.ts | 8 ++++---- library/src/schemas/optional/optional.ts | 1 + library/src/schemas/optional/optionalAsync.ts | 1 + library/src/schemas/record/record.ts | 10 +++++----- library/src/schemas/record/recordAsync.ts | 10 +++++----- library/src/schemas/set/set.ts | 8 ++++---- library/src/schemas/set/setAsync.ts | 8 ++++---- library/src/schemas/special/special.ts | 8 ++++---- library/src/schemas/special/specialAsync.ts | 10 +++++----- library/src/schemas/string/string.ts | 6 +++--- library/src/schemas/string/stringAsync.ts | 6 +++--- library/src/schemas/tuple/tuple.ts | 9 +++++---- library/src/schemas/tuple/tupleAsync.ts | 10 +++++----- library/src/utils/executePipe/executePipe.ts | 5 ++--- library/src/utils/executePipe/executePipeAsync.ts | 5 ++--- 48 files changed, 165 insertions(+), 152 deletions(-) diff --git a/library/src/error/flatten/flatten.ts b/library/src/error/flatten/flatten.ts index 464551820..6e2678b14 100644 --- a/library/src/error/flatten/flatten.ts +++ b/library/src/error/flatten/flatten.ts @@ -143,7 +143,8 @@ export function flatten( /** * - * @param arg1 + * @param arg1 A Vali error or issues. + * @returns Flat errors. */ export function flatten( arg1: ValiError | Issues diff --git a/library/src/methods/brand/brand.ts b/library/src/methods/brand/brand.ts index 0438d837e..6eae9cd2b 100644 --- a/library/src/methods/brand/brand.ts +++ b/library/src/methods/brand/brand.ts @@ -679,9 +679,8 @@ export function brand< /** * Brands the output type of a schema. - * @param schema The scheme to be branded. - * @param brand The brand name. - * @param name + * @param schema The schema to be branded. + * @param name The branded name. * @returns The branded schema. */ export function brand< diff --git a/library/src/methods/merge/merge.ts b/library/src/methods/merge/merge.ts index 5e274c4f9..03fb470dd 100644 --- a/library/src/methods/merge/merge.ts +++ b/library/src/methods/merge/merge.ts @@ -43,10 +43,10 @@ export function merge( ): ObjectSchema>; /** - * - * @param schemas - * @param arg2 - * @param arg3 + * @param schemas The schemas to be merged. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns An object schema. */ export function merge( schemas: TObjectSchemas, diff --git a/library/src/methods/merge/mergeAsync.ts b/library/src/methods/merge/mergeAsync.ts index 3446dbe1c..65d1dc18f 100644 --- a/library/src/methods/merge/mergeAsync.ts +++ b/library/src/methods/merge/mergeAsync.ts @@ -45,9 +45,10 @@ export function mergeAsync( /** * - * @param schemas - * @param arg2 - * @param arg3 + * @param schemas The schemas to be merged. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns An async object schema. */ export function mergeAsync( schemas: TObjectSchemas, diff --git a/library/src/methods/omit/omit.ts b/library/src/methods/omit/omit.ts index 3b6087286..3b5f0972e 100644 --- a/library/src/methods/omit/omit.ts +++ b/library/src/methods/omit/omit.ts @@ -45,10 +45,11 @@ export function omit< /** * - * @param schema - * @param keys - * @param arg3 - * @param arg4 + * @param schema The schema to omit from. + * @param keys The selected keys + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An object schema. */ export function omit< TObjectSchema extends ObjectSchema, diff --git a/library/src/methods/omit/omitAsync.ts b/library/src/methods/omit/omitAsync.ts index adb8514ed..eb6c6051c 100644 --- a/library/src/methods/omit/omitAsync.ts +++ b/library/src/methods/omit/omitAsync.ts @@ -46,10 +46,11 @@ export function omitAsync< /** * - * @param schema - * @param keys - * @param arg3 - * @param arg4 + * @param schema The schema to omit from. + * @param keys The selected keys + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An async object schema. */ export function omitAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, diff --git a/library/src/methods/partial/partial.ts b/library/src/methods/partial/partial.ts index 2ef8657bf..d9c884ca2 100644 --- a/library/src/methods/partial/partial.ts +++ b/library/src/methods/partial/partial.ts @@ -44,9 +44,10 @@ export function partial>( /** * - * @param schema - * @param arg3 - * @param arg4 + * @param schema The affected schema. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An object schema. */ export function partial>( schema: TObjectSchema, diff --git a/library/src/methods/partial/partialAsync.ts b/library/src/methods/partial/partialAsync.ts index f70b8daf7..00235ad61 100644 --- a/library/src/methods/partial/partialAsync.ts +++ b/library/src/methods/partial/partialAsync.ts @@ -49,9 +49,10 @@ export function partialAsync< /** * - * @param schema - * @param arg3 - * @param arg4 + * @param schema The affected schema. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An async object schema. */ export function partialAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync diff --git a/library/src/methods/pick/pick.ts b/library/src/methods/pick/pick.ts index 3467a0a71..277015be4 100644 --- a/library/src/methods/pick/pick.ts +++ b/library/src/methods/pick/pick.ts @@ -44,10 +44,11 @@ export function pick< /** * - * @param schema - * @param keys - * @param arg3 - * @param arg4 + * @param schema The schema to pick from. + * @param keys The selected keys + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An object schema. */ export function pick< TObjectSchema extends ObjectSchema, diff --git a/library/src/methods/pick/pickAsync.ts b/library/src/methods/pick/pickAsync.ts index e89a485c2..37eaef8f7 100644 --- a/library/src/methods/pick/pickAsync.ts +++ b/library/src/methods/pick/pickAsync.ts @@ -45,10 +45,11 @@ export function pickAsync< /** * - * @param schema - * @param keys - * @param arg3 - * @param arg4 + * @param schema The schema to pick from. + * @param keys The selected keys + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An async object schema. */ export function pickAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, diff --git a/library/src/methods/required/required.ts b/library/src/methods/required/required.ts index 4e90838c5..a27352bfe 100644 --- a/library/src/methods/required/required.ts +++ b/library/src/methods/required/required.ts @@ -44,9 +44,10 @@ export function required>( /** * - * @param schema - * @param arg3 - * @param arg4 + * @param schema The affected schema. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An object schema. */ export function required>( schema: TObjectSchema, diff --git a/library/src/methods/required/requiredAsync.ts b/library/src/methods/required/requiredAsync.ts index 673d0e390..5be5eaa31 100644 --- a/library/src/methods/required/requiredAsync.ts +++ b/library/src/methods/required/requiredAsync.ts @@ -48,10 +48,10 @@ export function requiredAsync< ): ObjectSchemaAsync>; /** - * - * @param schema - * @param arg3 - * @param arg4 + * @param schema The affected schema. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An async object schema. */ export function requiredAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync diff --git a/library/src/schemas/array/array.ts b/library/src/schemas/array/array.ts index e239e76a9..351bd29e3 100644 --- a/library/src/schemas/array/array.ts +++ b/library/src/schemas/array/array.ts @@ -50,10 +50,10 @@ export function array( ): ArraySchema; /** - * - * @param item - * @param arg2 - * @param arg3 + * @param item The item schema. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns A array schema. */ export function array( item: TArrayItem, diff --git a/library/src/schemas/array/arrayAsync.ts b/library/src/schemas/array/arrayAsync.ts index e049a57dc..b4510d80b 100644 --- a/library/src/schemas/array/arrayAsync.ts +++ b/library/src/schemas/array/arrayAsync.ts @@ -51,10 +51,10 @@ export function arrayAsync( ): ArraySchemaAsync; /** - * - * @param item - * @param arg2 - * @param arg3 + * @param item The item schema. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns An async array schema. */ export function arrayAsync( item: TArrayItem, diff --git a/library/src/schemas/bigint/bigint.ts b/library/src/schemas/bigint/bigint.ts index 93b356d79..49d58c129 100644 --- a/library/src/schemas/bigint/bigint.ts +++ b/library/src/schemas/bigint/bigint.ts @@ -28,9 +28,9 @@ export function bigint(pipe?: Pipe): BigintSchema; export function bigint(error?: ErrorMessage, pipe?: Pipe): BigintSchema; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns A bigint schema. */ export function bigint( arg1?: ErrorMessage | Pipe, diff --git a/library/src/schemas/bigint/bigintAsync.ts b/library/src/schemas/bigint/bigintAsync.ts index 59d4bdc40..c42b4c29a 100644 --- a/library/src/schemas/bigint/bigintAsync.ts +++ b/library/src/schemas/bigint/bigintAsync.ts @@ -34,9 +34,9 @@ export function bigintAsync( ): BigintSchemaAsync; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns An async bigint schema. */ export function bigintAsync( arg1?: ErrorMessage | PipeAsync, diff --git a/library/src/schemas/blob/blob.ts b/library/src/schemas/blob/blob.ts index b893e1b66..2d6044502 100644 --- a/library/src/schemas/blob/blob.ts +++ b/library/src/schemas/blob/blob.ts @@ -28,9 +28,9 @@ export function blob(pipe?: Pipe): BlobSchema; export function blob(error?: ErrorMessage, pipe?: Pipe): BlobSchema; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns A blob schema. */ export function blob( arg1?: ErrorMessage | Pipe, diff --git a/library/src/schemas/blob/blobAsync.ts b/library/src/schemas/blob/blobAsync.ts index 16e2482cd..427a4face 100644 --- a/library/src/schemas/blob/blobAsync.ts +++ b/library/src/schemas/blob/blobAsync.ts @@ -31,9 +31,9 @@ export function blobAsync( ): BlobSchemaAsync; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns An async blob schema. */ export function blobAsync( arg1?: ErrorMessage | PipeAsync, diff --git a/library/src/schemas/boolean/boolean.ts b/library/src/schemas/boolean/boolean.ts index 0c79aea0e..6f17c3150 100644 --- a/library/src/schemas/boolean/boolean.ts +++ b/library/src/schemas/boolean/boolean.ts @@ -31,9 +31,9 @@ export function boolean( ): BooleanSchema; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns A boolean schema. */ export function boolean( arg1?: ErrorMessage | Pipe, diff --git a/library/src/schemas/boolean/booleanAsync.ts b/library/src/schemas/boolean/booleanAsync.ts index e07cd40c6..7e2595e83 100644 --- a/library/src/schemas/boolean/booleanAsync.ts +++ b/library/src/schemas/boolean/booleanAsync.ts @@ -34,9 +34,9 @@ export function booleanAsync( ): BooleanSchemaAsync; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns An async boolean schema. */ export function booleanAsync( arg1?: ErrorMessage | PipeAsync, diff --git a/library/src/schemas/date/date.ts b/library/src/schemas/date/date.ts index a7a083a26..c136b623e 100644 --- a/library/src/schemas/date/date.ts +++ b/library/src/schemas/date/date.ts @@ -28,9 +28,9 @@ export function date(pipe?: Pipe): DateSchema; export function date(error?: ErrorMessage, pipe?: Pipe): DateSchema; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns A date schema. */ export function date( arg1?: ErrorMessage | Pipe, diff --git a/library/src/schemas/date/dateAsync.ts b/library/src/schemas/date/dateAsync.ts index a10489edd..faaf91bb2 100644 --- a/library/src/schemas/date/dateAsync.ts +++ b/library/src/schemas/date/dateAsync.ts @@ -31,9 +31,9 @@ export function dateAsync( ): DateSchemaAsync; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns An async date schema. */ export function dateAsync( arg1?: ErrorMessage | PipeAsync, diff --git a/library/src/schemas/instance/instance.ts b/library/src/schemas/instance/instance.ts index 28ad6289f..730daf91d 100644 --- a/library/src/schemas/instance/instance.ts +++ b/library/src/schemas/instance/instance.ts @@ -46,10 +46,10 @@ export function instance( ): InstanceSchema; /** - * - * @param of - * @param arg2 - * @param arg3 + * @param of The class of the instance. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns An instance schema. */ export function instance( of: TClass, diff --git a/library/src/schemas/instance/instanceAsync.ts b/library/src/schemas/instance/instanceAsync.ts index c19f813f6..28b511584 100644 --- a/library/src/schemas/instance/instanceAsync.ts +++ b/library/src/schemas/instance/instanceAsync.ts @@ -42,10 +42,10 @@ export function instanceAsync( ): InstanceSchemaAsync; /** - * - * @param of - * @param arg2 - * @param arg3 + * @param of The class of the instance. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns An async instance schema. */ export function instanceAsync( of: TClass, diff --git a/library/src/schemas/map/map.ts b/library/src/schemas/map/map.ts index 63d4a37a6..b7ffc470e 100644 --- a/library/src/schemas/map/map.ts +++ b/library/src/schemas/map/map.ts @@ -54,11 +54,11 @@ export function map( ): MapSchema; /** - * - * @param key - * @param value - * @param arg3 - * @param arg4 + * @param key The key schema. + * @param value The value schema. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns A map schema. */ export function map( key: TMapKey, diff --git a/library/src/schemas/map/mapAsync.ts b/library/src/schemas/map/mapAsync.ts index ded6023df..4b1e65945 100644 --- a/library/src/schemas/map/mapAsync.ts +++ b/library/src/schemas/map/mapAsync.ts @@ -61,11 +61,11 @@ export function mapAsync< ): MapSchemaAsync; /** - * - * @param key - * @param value - * @param arg3 - * @param arg4 + * @param key The key schema. + * @param value The value schema. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An async map schema. */ export function mapAsync< TMapKey extends BaseSchema | BaseSchemaAsync, diff --git a/library/src/schemas/nullable/nullable.ts b/library/src/schemas/nullable/nullable.ts index 965648681..43f8459db 100644 --- a/library/src/schemas/nullable/nullable.ts +++ b/library/src/schemas/nullable/nullable.ts @@ -42,6 +42,7 @@ export function nullable< /** * The default value. + * @returns The default value. */ get default() { return typeof default_ === 'function' diff --git a/library/src/schemas/nullable/nullableAsync.ts b/library/src/schemas/nullable/nullableAsync.ts index 5dc37174c..b5ea3f534 100644 --- a/library/src/schemas/nullable/nullableAsync.ts +++ b/library/src/schemas/nullable/nullableAsync.ts @@ -53,6 +53,7 @@ export function nullableAsync< /** * The default value. + * @returns The default value. */ get default() { return typeof default_ === 'function' diff --git a/library/src/schemas/nullish/nullish.ts b/library/src/schemas/nullish/nullish.ts index f70eb82f8..55e42ca7d 100644 --- a/library/src/schemas/nullish/nullish.ts +++ b/library/src/schemas/nullish/nullish.ts @@ -42,6 +42,7 @@ export function nullish< /** * The default value. + * @returns The default value. */ get default() { return typeof default_ === 'function' diff --git a/library/src/schemas/nullish/nullishAsync.ts b/library/src/schemas/nullish/nullishAsync.ts index 255339b05..17520a4e9 100644 --- a/library/src/schemas/nullish/nullishAsync.ts +++ b/library/src/schemas/nullish/nullishAsync.ts @@ -53,6 +53,7 @@ export function nullishAsync< /** * The default value. + * @returns The default value. */ get default() { return typeof default_ === 'function' diff --git a/library/src/schemas/number/number.ts b/library/src/schemas/number/number.ts index dce4addbf..39447170e 100644 --- a/library/src/schemas/number/number.ts +++ b/library/src/schemas/number/number.ts @@ -28,9 +28,9 @@ export function number(pipe?: Pipe): NumberSchema; export function number(error?: ErrorMessage, pipe?: Pipe): NumberSchema; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns A number schema. */ export function number( arg1?: ErrorMessage | Pipe, diff --git a/library/src/schemas/number/numberAsync.ts b/library/src/schemas/number/numberAsync.ts index 93766ca0d..cd8640d95 100644 --- a/library/src/schemas/number/numberAsync.ts +++ b/library/src/schemas/number/numberAsync.ts @@ -34,9 +34,9 @@ export function numberAsync( ): NumberSchemaAsync; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns An async number schema. */ export function numberAsync( arg1?: ErrorMessage | PipeAsync, diff --git a/library/src/schemas/object/object.ts b/library/src/schemas/object/object.ts index b9f4762d6..fc02dac7a 100644 --- a/library/src/schemas/object/object.ts +++ b/library/src/schemas/object/object.ts @@ -48,10 +48,10 @@ export function object( ): ObjectSchema; /** - * - * @param object - * @param arg2 - * @param arg3 + * @param object The object schema. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns An object schema. */ export function object( object: TObjectShape, diff --git a/library/src/schemas/object/objectAsync.ts b/library/src/schemas/object/objectAsync.ts index 83571f077..a04811ae0 100644 --- a/library/src/schemas/object/objectAsync.ts +++ b/library/src/schemas/object/objectAsync.ts @@ -57,10 +57,10 @@ export function objectAsync( ): ObjectSchemaAsync; /** - * - * @param object - * @param arg2 - * @param arg3 + * @param object The object schema. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns An async object schema. */ export function objectAsync( object: TObjectShape, diff --git a/library/src/schemas/optional/optional.ts b/library/src/schemas/optional/optional.ts index b682ee3b9..08cef97c9 100644 --- a/library/src/schemas/optional/optional.ts +++ b/library/src/schemas/optional/optional.ts @@ -42,6 +42,7 @@ export function optional< /** * The default value. + * @returns The default value. */ get default() { return typeof default_ === 'function' diff --git a/library/src/schemas/optional/optionalAsync.ts b/library/src/schemas/optional/optionalAsync.ts index 685b65571..fd93bb6d0 100644 --- a/library/src/schemas/optional/optionalAsync.ts +++ b/library/src/schemas/optional/optionalAsync.ts @@ -53,6 +53,7 @@ export function optionalAsync< /** * The default value. + * @returns The default value. */ get default() { return typeof default_ === 'function' diff --git a/library/src/schemas/record/record.ts b/library/src/schemas/record/record.ts index fa0446863..2fc4bc96a 100644 --- a/library/src/schemas/record/record.ts +++ b/library/src/schemas/record/record.ts @@ -86,11 +86,11 @@ export function record< ): RecordSchema; /** - * - * @param arg1 - * @param arg2 - * @param arg3 - * @param arg4 + * @param arg1 The value or key schema. + * @param arg2 A validation and transformation pipe, or an error message, or the value schema. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns A record schema. */ export function record< TRecordKey extends RecordKey, diff --git a/library/src/schemas/record/recordAsync.ts b/library/src/schemas/record/recordAsync.ts index e4f3f210c..3233b346c 100644 --- a/library/src/schemas/record/recordAsync.ts +++ b/library/src/schemas/record/recordAsync.ts @@ -102,11 +102,11 @@ export function recordAsync< ): RecordSchemaAsync; /** - * - * @param arg1 - * @param arg2 - * @param arg3 - * @param arg4 + * @param arg1 The value or key schema. + * @param arg2 A validation and transformation pipe, or an error message, or the value schema. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An async record schema. */ export function recordAsync< TRecordKey extends RecordKeyAsync, diff --git a/library/src/schemas/set/set.ts b/library/src/schemas/set/set.ts index 35125fc04..b393f7671 100644 --- a/library/src/schemas/set/set.ts +++ b/library/src/schemas/set/set.ts @@ -43,10 +43,10 @@ export function set( ): SetSchema; /** - * - * @param value - * @param arg2 - * @param arg3 + * @param value The value schema. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns A set schema. */ export function set( value: TSetValue, diff --git a/library/src/schemas/set/setAsync.ts b/library/src/schemas/set/setAsync.ts index 1d89709c4..f75a46e0a 100644 --- a/library/src/schemas/set/setAsync.ts +++ b/library/src/schemas/set/setAsync.ts @@ -49,10 +49,10 @@ export function setAsync( ): SetSchemaAsync; /** - * - * @param value - * @param arg2 - * @param arg3 + * @param value The value schema. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns An async set schema. */ export function setAsync( value: TSetValue, diff --git a/library/src/schemas/special/special.ts b/library/src/schemas/special/special.ts index b4d9437dc..c639a530b 100644 --- a/library/src/schemas/special/special.ts +++ b/library/src/schemas/special/special.ts @@ -40,10 +40,10 @@ export function special( ): SpecialSchema; /** - * - * @param check - * @param arg2 - * @param arg3 + * @param check The type check function. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns A special schema. */ export function special( check: (input: unknown) => boolean, diff --git a/library/src/schemas/special/specialAsync.ts b/library/src/schemas/special/specialAsync.ts index 707bff2dd..0e691030b 100644 --- a/library/src/schemas/special/specialAsync.ts +++ b/library/src/schemas/special/specialAsync.ts @@ -31,7 +31,7 @@ export function specialAsync( * @param check The type check function. * @param error The error message. * @param pipe A validation and transformation pipe. - * @returns A special schema. + * @returns An async special schema. */ export function specialAsync( check: (input: unknown) => boolean | Promise, @@ -40,10 +40,10 @@ export function specialAsync( ): SpecialSchemaAsync; /** - * - * @param check - * @param arg2 - * @param arg3 + * @param check The type check function. + * @param arg2 A validation and transformation pipe, or an error message. + * @param arg3 A validation and transformation pipe. + * @returns An async special schema. */ export function specialAsync( check: (input: unknown) => boolean | Promise, diff --git a/library/src/schemas/string/string.ts b/library/src/schemas/string/string.ts index 7696f692a..e4abd1146 100644 --- a/library/src/schemas/string/string.ts +++ b/library/src/schemas/string/string.ts @@ -28,9 +28,9 @@ export function string(pipe?: Pipe): StringSchema; export function string(error?: ErrorMessage, pipe?: Pipe): StringSchema; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns A string schema. */ export function string( arg1?: ErrorMessage | Pipe, diff --git a/library/src/schemas/string/stringAsync.ts b/library/src/schemas/string/stringAsync.ts index 26a7518a6..48fcd4116 100644 --- a/library/src/schemas/string/stringAsync.ts +++ b/library/src/schemas/string/stringAsync.ts @@ -34,9 +34,9 @@ export function stringAsync( ): StringSchemaAsync; /** - * - * @param arg1 - * @param arg2 + * @param arg1 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe. + * @returns An async string schema. */ export function stringAsync( arg1?: ErrorMessage | PipeAsync, diff --git a/library/src/schemas/tuple/tuple.ts b/library/src/schemas/tuple/tuple.ts index 4caa9f9e3..d5bf0efa8 100644 --- a/library/src/schemas/tuple/tuple.ts +++ b/library/src/schemas/tuple/tuple.ts @@ -80,10 +80,11 @@ export function tuple< /** * - * @param items - * @param arg2 - * @param arg3 - * @param arg4 + * @param items The items schema. + * @param arg2 A validation and transformation pipe, or an error message, or the rest schema. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns A tuple schema. */ export function tuple< TTupleItems extends TupleShape, diff --git a/library/src/schemas/tuple/tupleAsync.ts b/library/src/schemas/tuple/tupleAsync.ts index 69fccaecc..b884eafee 100644 --- a/library/src/schemas/tuple/tupleAsync.ts +++ b/library/src/schemas/tuple/tupleAsync.ts @@ -92,11 +92,11 @@ export function tupleAsync< ): TupleSchemaAsync; /** - * - * @param items - * @param arg2 - * @param arg3 - * @param arg4 + * @param items The items schema. + * @param arg2 A validation and transformation pipe, or an error message, or the rest schema. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * @returns An async tuple schema. */ export function tupleAsync< TTupleItems extends TupleShapeAsync, diff --git a/library/src/utils/executePipe/executePipe.ts b/library/src/utils/executePipe/executePipe.ts index 0afa3978e..05c1d4388 100644 --- a/library/src/utils/executePipe/executePipe.ts +++ b/library/src/utils/executePipe/executePipe.ts @@ -14,9 +14,8 @@ import { getIssue, getPipeInfo } from './utils/index.ts'; * Executes the validation and transformation pipe. * @param input The input value. * @param pipe The pipe to be executed. - * @param info The validation info. - * @param parseInfo - * @param reason + * @param parseInfo The parse info. + * @param reason The issue reason. * @returns The output value. */ export function executePipe( diff --git a/library/src/utils/executePipe/executePipeAsync.ts b/library/src/utils/executePipe/executePipeAsync.ts index 1d1fd5a9c..caba85efb 100644 --- a/library/src/utils/executePipe/executePipeAsync.ts +++ b/library/src/utils/executePipe/executePipeAsync.ts @@ -14,9 +14,8 @@ import { getIssue, getPipeInfo } from './utils/index.ts'; * Executes the async validation and transformation pipe. * @param input The input value. * @param pipe The pipe to be executed. - * @param info The validation info. - * @param parseInfo - * @param reason + * @param parseInfo The parse info. + * @param reason The issue reason. * @returns The output value. */ export async function executePipeAsync( From 00553beab4ef7dd59de9eba26dc22c88e66cf6b6 Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Mon, 9 Oct 2023 15:16:29 +0900 Subject: [PATCH 04/13] chore: add some empty blank rules --- library/.eslintrc.cjs | 4 ++++ library/src/comparable.ts | 2 ++ library/src/error/ValiError/ValiError.ts | 1 + library/src/error/flatten/flatten.ts | 5 +++++ library/src/methods/brand/brand.ts | 2 ++ library/src/methods/coerce/coerce.ts | 4 ++++ library/src/methods/coerce/coerceAsync.ts | 4 ++++ library/src/methods/fallback/fallback.ts | 4 ++++ library/src/methods/fallback/fallbackAsync.ts | 4 ++++ library/src/methods/getDefault/getDefault.ts | 2 ++ library/src/methods/is/is.ts | 2 ++ library/src/methods/keyof/keyof.ts | 2 ++ library/src/methods/merge/merge.ts | 5 +++++ library/src/methods/merge/mergeAsync.ts | 5 +++++ library/src/methods/omit/omit.ts | 5 +++++ library/src/methods/omit/omitAsync.ts | 5 +++++ library/src/methods/parse/parse.ts | 2 ++ library/src/methods/parse/parseAsync.ts | 2 ++ library/src/methods/partial/partial.ts | 5 +++++ library/src/methods/partial/partialAsync.ts | 5 +++++ library/src/methods/passthrough/passthrough.ts | 4 ++++ library/src/methods/passthrough/passthroughAsync.ts | 4 ++++ library/src/methods/pick/pick.ts | 5 +++++ library/src/methods/pick/pickAsync.ts | 5 +++++ library/src/methods/required/required.ts | 5 +++++ library/src/methods/required/requiredAsync.ts | 5 +++++ library/src/methods/safeParse/safeParse.ts | 2 ++ library/src/methods/safeParse/safeParseAsync.ts | 2 ++ library/src/methods/strict/strict.ts | 4 ++++ library/src/methods/strict/strictAsync.ts | 4 ++++ library/src/methods/strip/strip.ts | 4 ++++ library/src/methods/strip/stripAsync.ts | 4 ++++ library/src/methods/transform/transform.ts | 4 ++++ library/src/methods/transform/transformAsync.ts | 4 ++++ library/src/methods/unwrap/unwrap.ts | 2 ++ library/src/methods/withDefault/withDefault.ts | 8 +++++++- library/src/schemas/any/any.ts | 4 ++++ library/src/schemas/any/anyAsync.ts | 4 ++++ library/src/schemas/array/array.ts | 7 +++++++ library/src/schemas/array/arrayAsync.ts | 7 +++++++ library/src/schemas/bigint/bigint.ts | 7 +++++++ library/src/schemas/bigint/bigintAsync.ts | 7 +++++++ library/src/schemas/blob/blob.ts | 7 +++++++ library/src/schemas/blob/blobAsync.ts | 7 +++++++ library/src/schemas/boolean/boolean.ts | 7 +++++++ library/src/schemas/boolean/booleanAsync.ts | 7 +++++++ library/src/schemas/date/date.ts | 7 +++++++ library/src/schemas/date/dateAsync.ts | 7 +++++++ library/src/schemas/enumType/enumType.ts | 4 ++++ library/src/schemas/enumType/enumTypeAsync.ts | 4 ++++ library/src/schemas/instance/instance.ts | 7 +++++++ library/src/schemas/instance/instanceAsync.ts | 7 +++++++ library/src/schemas/intersection/intersection.ts | 4 ++++ library/src/schemas/intersection/intersectionAsync.ts | 4 ++++ .../intersection/utils/mergeOutputs/mergeOutputs.ts | 2 ++ library/src/schemas/literal/literal.ts | 4 ++++ library/src/schemas/literal/literalAsync.ts | 4 ++++ library/src/schemas/map/map.ts | 7 +++++++ library/src/schemas/map/mapAsync.ts | 7 +++++++ library/src/schemas/nan/nan.ts | 4 ++++ library/src/schemas/nan/nanAsync.ts | 4 ++++ library/src/schemas/nativeEnum/nativeEnum.ts | 4 ++++ library/src/schemas/nativeEnum/nativeEnumAsync.ts | 4 ++++ library/src/schemas/never/never.ts | 4 ++++ library/src/schemas/never/neverAsync.ts | 4 ++++ library/src/schemas/nonNullable/nonNullable.ts | 4 ++++ library/src/schemas/nonNullable/nonNullableAsync.ts | 4 ++++ library/src/schemas/nonNullish/nonNullish.ts | 4 ++++ library/src/schemas/nonNullish/nonNullishAsync.ts | 4 ++++ library/src/schemas/nonOptional/nonOptional.ts | 4 ++++ library/src/schemas/nonOptional/nonOptionalAsync.ts | 4 ++++ library/src/schemas/nullType/nullType.ts | 4 ++++ library/src/schemas/nullType/nullTypeAsync.ts | 4 ++++ library/src/schemas/nullable/nullable.ts | 5 +++++ library/src/schemas/nullable/nullableAsync.ts | 5 +++++ library/src/schemas/nullish/nullish.ts | 5 +++++ library/src/schemas/nullish/nullishAsync.ts | 5 +++++ library/src/schemas/number/number.ts | 7 +++++++ library/src/schemas/number/numberAsync.ts | 7 +++++++ library/src/schemas/object/object.ts | 7 +++++++ library/src/schemas/object/objectAsync.ts | 7 +++++++ library/src/schemas/optional/optional.ts | 5 +++++ library/src/schemas/optional/optionalAsync.ts | 5 +++++ library/src/schemas/record/record.ts | 11 +++++++++++ library/src/schemas/record/recordAsync.ts | 11 +++++++++++ .../record/utils/getRecordArgs/getRecordArgs.ts | 2 ++ library/src/schemas/recursive/recursive.ts | 4 ++++ library/src/schemas/recursive/recursiveAsync.ts | 4 ++++ library/src/schemas/set/set.ts | 7 +++++++ library/src/schemas/set/setAsync.ts | 7 +++++++ library/src/schemas/special/special.ts | 7 +++++++ library/src/schemas/special/specialAsync.ts | 7 +++++++ library/src/schemas/string/string.ts | 7 +++++++ library/src/schemas/string/stringAsync.ts | 7 +++++++ library/src/schemas/symbol/symbol.ts | 4 ++++ library/src/schemas/symbol/symbolAsync.ts | 4 ++++ library/src/schemas/tuple/tuple.ts | 11 +++++++++++ library/src/schemas/tuple/tupleAsync.ts | 11 +++++++++++ .../schemas/tuple/utils/getTupleArgs/getTupleArgs.ts | 2 ++ library/src/schemas/undefinedType/undefinedType.ts | 4 ++++ .../src/schemas/undefinedType/undefinedTypeAsync.ts | 4 ++++ library/src/schemas/union/union.ts | 4 ++++ library/src/schemas/union/unionAsync.ts | 4 ++++ library/src/schemas/unknown/unknown.ts | 4 ++++ library/src/schemas/unknown/unknownAsync.ts | 4 ++++ library/src/schemas/voidType/voidType.ts | 4 ++++ library/src/schemas/voidType/voidTypeAsync.ts | 4 ++++ library/src/transformations/toCustom/toCustom.ts | 2 ++ library/src/transformations/toCustom/toCustomAsync.ts | 2 ++ .../src/transformations/toLowerCase/toLowerCase.ts | 1 + library/src/transformations/toMaxValue/toMaxValue.ts | 2 ++ library/src/transformations/toMinValue/toMinValue.ts | 2 ++ library/src/transformations/toTrimmed/toTrimmed.ts | 1 + .../src/transformations/toTrimmedEnd/toTrimmedEnd.ts | 1 + .../transformations/toTrimmedStart/toTrimmedStart.ts | 1 + .../src/transformations/toUpperCase/toUpperCase.ts | 1 + library/src/utils/executePipe/executePipe.ts | 2 ++ library/src/utils/executePipe/executePipeAsync.ts | 2 ++ .../src/utils/executePipe/utils/getIssue/getIssue.ts | 2 ++ .../executePipe/utils/getPipeInfo/getPipeInfo.ts | 2 ++ library/src/utils/getDefaultArgs/getDefaultArgs.ts | 2 ++ library/src/utils/getErrorMessage/getErrorMessage.ts | 2 ++ library/src/utils/getIssues/getIssues.ts | 2 ++ library/src/utils/getOutput/getOutput.ts | 2 ++ library/src/utils/getPipeIssues/getPipeIssues.ts | 2 ++ library/src/utils/getSchemaIssues/getSchemaIssues.ts | 2 ++ library/src/utils/isLuhnAlgo/isLuhnAlgo.ts | 2 ++ library/src/validations/bytes/bytes.ts | 2 ++ library/src/validations/cuid2/cuid2.ts | 2 ++ library/src/validations/custom/custom.ts | 2 ++ library/src/validations/custom/customAsync.ts | 2 ++ library/src/validations/email/email.ts | 2 ++ library/src/validations/emoji/emoji.ts | 2 ++ library/src/validations/endsWith/endsWith.ts | 2 ++ library/src/validations/equal/equal.ts | 5 ++++- library/src/validations/excludes/excludes.ts | 2 ++ library/src/validations/finite/finite.ts | 2 ++ library/src/validations/imei/imei.ts | 2 ++ library/src/validations/includes/includes.ts | 2 ++ library/src/validations/integer/integer.ts | 2 ++ library/src/validations/ip/ip.ts | 2 ++ library/src/validations/ipv4/ipv4.ts | 2 ++ library/src/validations/ipv6/ipv6.ts | 2 ++ library/src/validations/isoDate/isoDate.ts | 2 ++ library/src/validations/isoDateTime/isoDateTime.ts | 2 ++ library/src/validations/isoTime/isoTime.ts | 2 ++ .../src/validations/isoTimeSecond/isoTimeSecond.ts | 2 ++ library/src/validations/isoTimestamp/isoTimestamp.ts | 2 ++ library/src/validations/isoWeek/isoWeek.ts | 2 ++ library/src/validations/length/length.ts | 2 ++ library/src/validations/maxBytes/maxBytes.ts | 2 ++ library/src/validations/maxLength/maxLength.ts | 2 ++ library/src/validations/maxSize/maxSize.ts | 2 ++ library/src/validations/maxValue/maxValue.ts | 3 +++ library/src/validations/mimeType/mimeType.ts | 2 ++ library/src/validations/minBytes/minBytes.ts | 2 ++ library/src/validations/minLength/minLength.ts | 2 ++ library/src/validations/minSize/minSize.ts | 2 ++ library/src/validations/minValue/minValue.ts | 3 +++ library/src/validations/multipleOf/multipleOf.ts | 2 ++ library/src/validations/notBytes/notBytes.ts | 2 ++ library/src/validations/notLength/notLength.ts | 2 ++ library/src/validations/notSize/notSize.ts | 2 ++ library/src/validations/notValue/notValue.ts | 2 ++ library/src/validations/regex/regex.ts | 2 ++ library/src/validations/safeInteger/safeInteger.ts | 2 ++ library/src/validations/size/size.ts | 2 ++ library/src/validations/startsWith/startsWith.ts | 2 ++ library/src/validations/ulid/ulid.ts | 2 ++ library/src/validations/url/url.ts | 2 ++ library/src/validations/uuid/uuid.ts | 2 ++ library/src/validations/value/value.ts | 2 ++ 172 files changed, 648 insertions(+), 2 deletions(-) diff --git a/library/.eslintrc.cjs b/library/.eslintrc.cjs index e51c08e84..ea2c67dca 100644 --- a/library/.eslintrc.cjs +++ b/library/.eslintrc.cjs @@ -15,5 +15,9 @@ module.exports = { '@typescript-eslint/no-non-null-assertion': 'off', 'no-duplicate-imports': 'off', 'import/extensions': ['error', 'always'], + 'jsdoc/tag-lines': ['error', 'any', { + 'startLines': 1, + }], + 'jsdoc/sort-tags': ['error', { 'linesBetween': 1, "tagSequence": [{ "tags": ["param"] }, { "tags": ["returns"] }] }] }, }; diff --git a/library/src/comparable.ts b/library/src/comparable.ts index dd7d8ce6d..93b653cea 100644 --- a/library/src/comparable.ts +++ b/library/src/comparable.ts @@ -2,7 +2,9 @@ import { expect } from 'vitest'; /** * Prepares an object so that it can be compared to another with `.toEqual`. + * * @param value The object to prepare. + * * @returns The comparable object. */ export function comparable(value: any): any { diff --git a/library/src/error/ValiError/ValiError.ts b/library/src/error/ValiError/ValiError.ts index cb32defbc..615294082 100644 --- a/library/src/error/ValiError/ValiError.ts +++ b/library/src/error/ValiError/ValiError.ts @@ -8,6 +8,7 @@ export class ValiError extends Error { /** * Creates a Valibot error with useful information. + * * @param issues The error issues. */ constructor(issues: Issues) { diff --git a/library/src/error/flatten/flatten.ts b/library/src/error/flatten/flatten.ts index 6e2678b14..07519232b 100644 --- a/library/src/error/flatten/flatten.ts +++ b/library/src/error/flatten/flatten.ts @@ -125,7 +125,9 @@ export type FlatErrors = { /** * Flatten the error messages of a Vali error. + * * @param error A Vali error. + * * @returns Flat errors. */ export function flatten( @@ -134,7 +136,9 @@ export function flatten( /** * Flatten the error messages of issues. + * * @param issues The issues. + * * @returns Flat errors. */ export function flatten( @@ -144,6 +148,7 @@ export function flatten( /** * * @param arg1 A Vali error or issues. + * * @returns Flat errors. */ export function flatten( diff --git a/library/src/methods/brand/brand.ts b/library/src/methods/brand/brand.ts index 6eae9cd2b..ec2c78a1f 100644 --- a/library/src/methods/brand/brand.ts +++ b/library/src/methods/brand/brand.ts @@ -679,8 +679,10 @@ export function brand< /** * Brands the output type of a schema. + * * @param schema The schema to be branded. * @param name The branded name. + * * @returns The branded schema. */ export function brand< diff --git a/library/src/methods/coerce/coerce.ts b/library/src/methods/coerce/coerce.ts index 0bd459083..c0dce8352 100644 --- a/library/src/methods/coerce/coerce.ts +++ b/library/src/methods/coerce/coerce.ts @@ -2,8 +2,10 @@ import type { BaseSchema, Input } from '../../types.ts'; /** * Coerces the input of a schema to match the required type. + * * @param schema The affected schema. * @param action The coerceation action. + * * @returns The passed schema. */ export function coerce( @@ -15,8 +17,10 @@ export function coerce( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/coerce/coerceAsync.ts b/library/src/methods/coerce/coerceAsync.ts index 311e768ef..63c4d263d 100644 --- a/library/src/methods/coerce/coerceAsync.ts +++ b/library/src/methods/coerce/coerceAsync.ts @@ -2,8 +2,10 @@ import type { BaseSchemaAsync, Input } from '../../types.ts'; /** * Coerces the input of a async schema to match the required type. + * * @param schema The affected schema. * @param action The coerceation action. + * * @returns The passed schema. */ export function coerceAsync( @@ -15,8 +17,10 @@ export function coerceAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/fallback/fallback.ts b/library/src/methods/fallback/fallback.ts index 915946392..9963d8122 100644 --- a/library/src/methods/fallback/fallback.ts +++ b/library/src/methods/fallback/fallback.ts @@ -4,8 +4,10 @@ import type { FallbackInfo } from './types.ts'; /** * Returns a fallback value when validating the passed schema failed. + * * @param schema The schema to catch. * @param value The fallback value. + * * @returns The passed schema. */ export function fallback( @@ -17,8 +19,10 @@ export function fallback( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/fallback/fallbackAsync.ts b/library/src/methods/fallback/fallbackAsync.ts index 346920e59..26a4a1f04 100644 --- a/library/src/methods/fallback/fallbackAsync.ts +++ b/library/src/methods/fallback/fallbackAsync.ts @@ -4,8 +4,10 @@ import type { FallbackInfo } from './types.ts'; /** * Returns a fallback value when validating the passed schema failed. + * * @param schema The schema to catch. * @param value The fallback value. + * * @returns The passed schema. */ export function fallbackAsync( @@ -17,8 +19,10 @@ export function fallbackAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/getDefault/getDefault.ts b/library/src/methods/getDefault/getDefault.ts index 795f2256a..c0ca85582 100644 --- a/library/src/methods/getDefault/getDefault.ts +++ b/library/src/methods/getDefault/getDefault.ts @@ -9,7 +9,9 @@ import type { /** * Returns the default value of the schema. + * * @param schema The schema to get the default value from. + * * @returns The default value. */ export function getDefault< diff --git a/library/src/methods/is/is.ts b/library/src/methods/is/is.ts index 6262c4acf..a7b641d58 100644 --- a/library/src/methods/is/is.ts +++ b/library/src/methods/is/is.ts @@ -3,8 +3,10 @@ import type { BaseSchema, Input } from '../../types.ts'; /** * Checks if the input matches the scheme. By using a type predicate, this * function can be used as a type guard. + * * @param schema The schema to be used. * @param input The input to be tested. + * * @returns Whether the input matches the scheme. */ export function is( diff --git a/library/src/methods/keyof/keyof.ts b/library/src/methods/keyof/keyof.ts index c5c2467d5..ac52dd8e9 100644 --- a/library/src/methods/keyof/keyof.ts +++ b/library/src/methods/keyof/keyof.ts @@ -30,7 +30,9 @@ type TupleOrNever = T extends [string, ...string[]] ? T : never; /** * Creates a enum schema of object keys. + * * @param schema The object schema. + * * @returns A enum schema. */ export function keyof< diff --git a/library/src/methods/merge/merge.ts b/library/src/methods/merge/merge.ts index 03fb470dd..5957ac743 100644 --- a/library/src/methods/merge/merge.ts +++ b/library/src/methods/merge/merge.ts @@ -19,8 +19,10 @@ type ObjectSchemas = [ /** * Merges multiple object schemas into a single one. Subsequent object schemas * overwrite the previous ones. + * * @param schemas The schemas to be merged. * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function merge( @@ -31,9 +33,11 @@ export function merge( /** * Merges multiple object schemas into a single one. Subsequent object schemas * overwrite the previous ones. + * * @param schemas The schemas to be merged. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function merge( @@ -46,6 +50,7 @@ export function merge( * @param schemas The schemas to be merged. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns An object schema. */ export function merge( diff --git a/library/src/methods/merge/mergeAsync.ts b/library/src/methods/merge/mergeAsync.ts index 65d1dc18f..cab4c4236 100644 --- a/library/src/methods/merge/mergeAsync.ts +++ b/library/src/methods/merge/mergeAsync.ts @@ -20,8 +20,10 @@ type ObjectSchemas = [ /** * Merges multiple async object schemas into a single one. Subsequent object * schemas overwrite the previous ones. + * * @param schemas The schemas to be merged. * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function mergeAsync( @@ -32,9 +34,11 @@ export function mergeAsync( /** * Merges multiple async object schemas into a single one. Subsequent object * schemas overwrite the previous ones. + * * @param schemas The schemas to be merged. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function mergeAsync( @@ -48,6 +52,7 @@ export function mergeAsync( * @param schemas The schemas to be merged. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns An async object schema. */ export function mergeAsync( diff --git a/library/src/methods/omit/omit.ts b/library/src/methods/omit/omit.ts index 3b5f0972e..f75beb167 100644 --- a/library/src/methods/omit/omit.ts +++ b/library/src/methods/omit/omit.ts @@ -10,9 +10,11 @@ import type { ObjectKeys } from './types.ts'; /** * Creates an object schema that contains not the selected keys of an existing * schema. + * * @param schema The schema to omit from. * @param keys The selected keys * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function omit< @@ -27,10 +29,12 @@ export function omit< /** * Creates an object schema that contains not the selected keys of an existing * schema. + * * @param schema The schema to omit from. * @param keys The selected keys * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function omit< @@ -49,6 +53,7 @@ export function omit< * @param keys The selected keys * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An object schema. */ export function omit< diff --git a/library/src/methods/omit/omitAsync.ts b/library/src/methods/omit/omitAsync.ts index eb6c6051c..9f6cf8104 100644 --- a/library/src/methods/omit/omitAsync.ts +++ b/library/src/methods/omit/omitAsync.ts @@ -11,9 +11,11 @@ import type { ObjectKeys } from './types.ts'; /** * Creates an async object schema that contains only the selected keys of an * existing schema. + * * @param schema The schema to omit from. * @param keys The selected keys * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function omitAsync< @@ -28,10 +30,12 @@ export function omitAsync< /** * Creates an async object schema that contains only the selected keys of an * existing schema. + * * @param schema The schema to omit from. * @param keys The selected keys * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function omitAsync< @@ -50,6 +54,7 @@ export function omitAsync< * @param keys The selected keys * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An async object schema. */ export function omitAsync< diff --git a/library/src/methods/parse/parse.ts b/library/src/methods/parse/parse.ts index cb307ffd4..56ad81768 100644 --- a/library/src/methods/parse/parse.ts +++ b/library/src/methods/parse/parse.ts @@ -3,9 +3,11 @@ import type { BaseSchema, Output, ParseInfo } from '../../types.ts'; /** * Parses unknown input based on a schema. + * * @param schema The schema to be used. * @param input The input to be parsed. * @param info The optional parse info. + * * @returns The parsed output. */ export function parse( diff --git a/library/src/methods/parse/parseAsync.ts b/library/src/methods/parse/parseAsync.ts index ed24640ed..a573ade7b 100644 --- a/library/src/methods/parse/parseAsync.ts +++ b/library/src/methods/parse/parseAsync.ts @@ -8,9 +8,11 @@ import type { /** * Parses unknown input based on a schema. + * * @param schema The schema to be used. * @param input The input to be parsed. * @param info The optional parse info. + * * @returns The parsed output. */ export async function parseAsync( diff --git a/library/src/methods/partial/partial.ts b/library/src/methods/partial/partial.ts index d9c884ca2..e47b0b6c5 100644 --- a/library/src/methods/partial/partial.ts +++ b/library/src/methods/partial/partial.ts @@ -19,8 +19,10 @@ type Partial = { /** * Creates an object schema consisting of all properties of an existing object * schema set to optional. + * * @param schema The affected schema. * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function partial>( @@ -31,9 +33,11 @@ export function partial>( /** * Creates an object schema consisting of all properties of an existing object * schema set to optional. + * * @param schema The affected schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function partial>( @@ -47,6 +51,7 @@ export function partial>( * @param schema The affected schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An object schema. */ export function partial>( diff --git a/library/src/methods/partial/partialAsync.ts b/library/src/methods/partial/partialAsync.ts index 00235ad61..8aa4228d4 100644 --- a/library/src/methods/partial/partialAsync.ts +++ b/library/src/methods/partial/partialAsync.ts @@ -20,8 +20,10 @@ type Partial = { /** * Creates an async object schema consisting of all properties of an existing * object schema set to optional. + * * @param schema The affected schema. * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function partialAsync< @@ -34,9 +36,11 @@ export function partialAsync< /** * Creates an async object schema consisting of all properties of an existing * object schema set to optional. + * * @param schema The affected schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function partialAsync< @@ -52,6 +56,7 @@ export function partialAsync< * @param schema The affected schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An async object schema. */ export function partialAsync< diff --git a/library/src/methods/passthrough/passthrough.ts b/library/src/methods/passthrough/passthrough.ts index 052083c50..979d80863 100644 --- a/library/src/methods/passthrough/passthrough.ts +++ b/library/src/methods/passthrough/passthrough.ts @@ -3,7 +3,9 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates an object schema that passes unknown keys. + * * @param schema A object schema. + * * @returns A object schema. */ export function passthrough>( @@ -14,8 +16,10 @@ export function passthrough>( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/passthrough/passthroughAsync.ts b/library/src/methods/passthrough/passthroughAsync.ts index eef9b5482..b64be54e8 100644 --- a/library/src/methods/passthrough/passthroughAsync.ts +++ b/library/src/methods/passthrough/passthroughAsync.ts @@ -3,7 +3,9 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates an object schema that passes unknown keys. + * * @param schema A object schema. + * * @returns A object schema. */ export function passthroughAsync>( @@ -14,8 +16,10 @@ export function passthroughAsync>( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/pick/pick.ts b/library/src/methods/pick/pick.ts index 277015be4..853e5ee4e 100644 --- a/library/src/methods/pick/pick.ts +++ b/library/src/methods/pick/pick.ts @@ -9,9 +9,11 @@ import { getDefaultArgs } from '../../utils/index.ts'; /** * Creates an object schema that contains only the selected keys of an existing * schema. + * * @param schema The schema to pick from. * @param keys The selected keys * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function pick< @@ -26,10 +28,12 @@ export function pick< /** * Creates an object schema that contains only the selected keys of an existing * schema. + * * @param schema The schema to pick from. * @param keys The selected keys * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function pick< @@ -48,6 +52,7 @@ export function pick< * @param keys The selected keys * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An object schema. */ export function pick< diff --git a/library/src/methods/pick/pickAsync.ts b/library/src/methods/pick/pickAsync.ts index 37eaef8f7..0f8181eba 100644 --- a/library/src/methods/pick/pickAsync.ts +++ b/library/src/methods/pick/pickAsync.ts @@ -10,9 +10,11 @@ import { getDefaultArgs } from '../../utils/index.ts'; /** * Creates an async object schema that contains only the selected keys of an * existing schema. + * * @param schema The schema to pick from. * @param keys The selected keys * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function pickAsync< @@ -27,10 +29,12 @@ export function pickAsync< /** * Creates an async object schema that contains only the selected keys of an * existing schema. + * * @param schema The schema to pick from. * @param keys The selected keys * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function pickAsync< @@ -49,6 +53,7 @@ export function pickAsync< * @param keys The selected keys * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An async object schema. */ export function pickAsync< diff --git a/library/src/methods/required/required.ts b/library/src/methods/required/required.ts index a27352bfe..6339c475b 100644 --- a/library/src/methods/required/required.ts +++ b/library/src/methods/required/required.ts @@ -19,8 +19,10 @@ type Required = { /** * Creates an object schema consisting of all properties of an existing object * schema set to none optional. + * * @param schema The affected schema. * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function required>( @@ -31,9 +33,11 @@ export function required>( /** * Creates an object schema consisting of all properties of an existing object * schema set to none optional. + * * @param schema The affected schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function required>( @@ -47,6 +51,7 @@ export function required>( * @param schema The affected schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An object schema. */ export function required>( diff --git a/library/src/methods/required/requiredAsync.ts b/library/src/methods/required/requiredAsync.ts index 5be5eaa31..ca3024ec8 100644 --- a/library/src/methods/required/requiredAsync.ts +++ b/library/src/methods/required/requiredAsync.ts @@ -20,8 +20,10 @@ type Required = { /** * Creates an async object schema consisting of all properties of an existing * object schema set to none optional. + * * @param schema The affected schema. * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function requiredAsync< @@ -34,9 +36,11 @@ export function requiredAsync< /** * Creates an async object schema consisting of all properties of an existing * object schema set to none optional. + * * @param schema The affected schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function requiredAsync< @@ -51,6 +55,7 @@ export function requiredAsync< * @param schema The affected schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An async object schema. */ export function requiredAsync< diff --git a/library/src/methods/safeParse/safeParse.ts b/library/src/methods/safeParse/safeParse.ts index 68f65e0c7..b3d8ce2c8 100644 --- a/library/src/methods/safeParse/safeParse.ts +++ b/library/src/methods/safeParse/safeParse.ts @@ -4,9 +4,11 @@ import type { SafeParseResult } from './types.ts'; /** * Parses unknown input based on a schema. + * * @param schema The schema to be used. * @param input The input to be parsed. * @param info The optional parse info. + * * @returns The parsed output. */ export function safeParse( diff --git a/library/src/methods/safeParse/safeParseAsync.ts b/library/src/methods/safeParse/safeParseAsync.ts index 7b78e5ea8..89c7bc666 100644 --- a/library/src/methods/safeParse/safeParseAsync.ts +++ b/library/src/methods/safeParse/safeParseAsync.ts @@ -4,9 +4,11 @@ import type { SafeParseResult } from './types.ts'; /** * Parses unknown input based on a schema. + * * @param schema The schema to be used. * @param input The input to be parsed. * @param info The optional parse info. + * * @returns The parsed output. */ export async function safeParseAsync< diff --git a/library/src/methods/strict/strict.ts b/library/src/methods/strict/strict.ts index 50c3ab58e..2e7cf95be 100644 --- a/library/src/methods/strict/strict.ts +++ b/library/src/methods/strict/strict.ts @@ -5,8 +5,10 @@ import { getSchemaIssues } from '../../utils/index.ts'; /** * Creates a strict object schema that throws an error if an input contains * unknown keys. + * * @param schema A object schema. * @param error The error message. + * * @returns A strict object schema. */ export function strict>( @@ -18,8 +20,10 @@ export function strict>( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/strict/strictAsync.ts b/library/src/methods/strict/strictAsync.ts index a0f5dffa5..0087d4f49 100644 --- a/library/src/methods/strict/strictAsync.ts +++ b/library/src/methods/strict/strictAsync.ts @@ -5,8 +5,10 @@ import { getSchemaIssues } from '../../utils/index.ts'; /** * Creates a strict async object schema that throws an error if an input * contains unknown keys. + * * @param schema A object schema. * @param error The error message. + * * @returns A strict object schema. */ export function strictAsync>( @@ -18,8 +20,10 @@ export function strictAsync>( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/strip/strip.ts b/library/src/methods/strip/strip.ts index 9f2c0301d..92db62cc7 100644 --- a/library/src/methods/strip/strip.ts +++ b/library/src/methods/strip/strip.ts @@ -3,7 +3,9 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates an object schema that strips unknown keys. + * * @param schema A object schema. + * * @returns A object schema. */ export function strip>( @@ -18,8 +20,10 @@ export function strip>( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/strip/stripAsync.ts b/library/src/methods/strip/stripAsync.ts index 5e4ebf0ce..8d98b1d1d 100644 --- a/library/src/methods/strip/stripAsync.ts +++ b/library/src/methods/strip/stripAsync.ts @@ -3,7 +3,9 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates an object schema that strips unknown keys. + * * @param schema A object schema. + * * @returns A object schema. */ export function stripAsync>( @@ -18,8 +20,10 @@ export function stripAsync>( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/transform/transform.ts b/library/src/methods/transform/transform.ts index 328f2e35d..d1730aa21 100644 --- a/library/src/methods/transform/transform.ts +++ b/library/src/methods/transform/transform.ts @@ -210,8 +210,10 @@ export function transform( /** * Adds a transformation step to a schema, which is executed at the end of * parsing and can change the output type. + * * @param schema The schema to be used. * @param action The transformation action. + * * @returns A transformed schema. */ export function transform( @@ -223,8 +225,10 @@ export function transform( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/methods/transform/transformAsync.ts b/library/src/methods/transform/transformAsync.ts index b3bf433f0..3065d9df7 100644 --- a/library/src/methods/transform/transformAsync.ts +++ b/library/src/methods/transform/transformAsync.ts @@ -356,8 +356,10 @@ export function transformAsync< /** * Adds an async transformation step to a schema, which is executed at the end * of parsing and can change the output type. + * * @param schema The schema to be used. * @param action The transformation action. + * * @returns A transformed schema. */ export function transformAsync< @@ -377,8 +379,10 @@ export function transformAsync< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/methods/unwrap/unwrap.ts b/library/src/methods/unwrap/unwrap.ts index 60daa22cf..45921b4aa 100644 --- a/library/src/methods/unwrap/unwrap.ts +++ b/library/src/methods/unwrap/unwrap.ts @@ -15,7 +15,9 @@ import type { /** * Unwraps the wrapped schema. + * * @param schema The schema to be unwrapped. + * * @returns The unwrapped schema. */ export function unwrap< diff --git a/library/src/methods/withDefault/withDefault.ts b/library/src/methods/withDefault/withDefault.ts index 8468893fe..3912be290 100644 --- a/library/src/methods/withDefault/withDefault.ts +++ b/library/src/methods/withDefault/withDefault.ts @@ -2,10 +2,13 @@ import type { BaseSchema, BaseSchemaAsync, Input } from '../../types.ts'; /** * Passes a default value to a schema in case of an undefined input. - * @deprecated Use `optional` instead. + * * @param schema The affected schema. * @param value The default value. + * * @returns The passed schema. + * + * @deprecated Use `optional` instead. */ export function withDefault( schema: TSchema, @@ -16,8 +19,10 @@ export function withDefault( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { @@ -35,6 +40,7 @@ export function withDefault( /** * See {@link withDefault} + * * @deprecated Use `optional` instead. */ export const useDefault = withDefault; diff --git a/library/src/schemas/any/any.ts b/library/src/schemas/any/any.ts index 95ce26467..ae30f4fd1 100644 --- a/library/src/schemas/any/any.ts +++ b/library/src/schemas/any/any.ts @@ -10,7 +10,9 @@ export type AnySchema = BaseSchema & { /** * Creates a any schema. + * * @param pipe A validation and transformation pipe. + * * @returns A any schema. */ export function any(pipe: Pipe = []): AnySchema { @@ -27,8 +29,10 @@ export function any(pipe: Pipe = []): AnySchema { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/any/anyAsync.ts b/library/src/schemas/any/anyAsync.ts index 48f09ebdd..1e56b2539 100644 --- a/library/src/schemas/any/anyAsync.ts +++ b/library/src/schemas/any/anyAsync.ts @@ -10,7 +10,9 @@ export type AnySchemaAsync = BaseSchemaAsync & { /** * Creates an async any schema. + * * @param pipe A validation and transformation pipe. + * * @returns An async any schema. */ export function anyAsync(pipe: PipeAsync = []): AnySchemaAsync { @@ -27,8 +29,10 @@ export function anyAsync(pipe: PipeAsync = []): AnySchemaAsync { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/array/array.ts b/library/src/schemas/array/array.ts index 351bd29e3..f866f71de 100644 --- a/library/src/schemas/array/array.ts +++ b/library/src/schemas/array/array.ts @@ -27,8 +27,10 @@ export type ArraySchema< /** * Creates a array schema. + * * @param item The item schema. * @param pipe A validation and transformation pipe. + * * @returns A array schema. */ export function array( @@ -38,9 +40,11 @@ export function array( /** * Creates a array schema. + * * @param item The item schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A array schema. */ export function array( @@ -53,6 +57,7 @@ export function array( * @param item The item schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns A array schema. */ export function array( @@ -82,8 +87,10 @@ export function array( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/array/arrayAsync.ts b/library/src/schemas/array/arrayAsync.ts index b4510d80b..6f805c89e 100644 --- a/library/src/schemas/array/arrayAsync.ts +++ b/library/src/schemas/array/arrayAsync.ts @@ -28,8 +28,10 @@ export type ArraySchemaAsync< /** * Creates an async array schema. + * * @param item The item schema. * @param pipe A validation and transformation pipe. + * * @returns An async array schema. */ export function arrayAsync( @@ -39,9 +41,11 @@ export function arrayAsync( /** * Creates an async array schema. + * * @param item The item schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async array schema. */ export function arrayAsync( @@ -54,6 +58,7 @@ export function arrayAsync( * @param item The item schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns An async array schema. */ export function arrayAsync( @@ -83,8 +88,10 @@ export function arrayAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/bigint/bigint.ts b/library/src/schemas/bigint/bigint.ts index 49d58c129..e94c5f203 100644 --- a/library/src/schemas/bigint/bigint.ts +++ b/library/src/schemas/bigint/bigint.ts @@ -14,15 +14,19 @@ export type BigintSchema = BaseSchema & { /** * Creates a bigint schema. + * * @param pipe A validation and transformation pipe. + * * @returns A bigint schema. */ export function bigint(pipe?: Pipe): BigintSchema; /** * Creates a bigint schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A bigint schema. */ export function bigint(error?: ErrorMessage, pipe?: Pipe): BigintSchema; @@ -30,6 +34,7 @@ export function bigint(error?: ErrorMessage, pipe?: Pipe): BigintSchema; /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns A bigint schema. */ export function bigint( @@ -53,8 +58,10 @@ export function bigint( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/bigint/bigintAsync.ts b/library/src/schemas/bigint/bigintAsync.ts index c42b4c29a..34732f9b6 100644 --- a/library/src/schemas/bigint/bigintAsync.ts +++ b/library/src/schemas/bigint/bigintAsync.ts @@ -17,15 +17,19 @@ export type BigintSchemaAsync = BaseSchemaAsync< /** * Creates an async bigint schema. + * * @param pipe A validation and transformation pipe. + * * @returns An async bigint schema. */ export function bigintAsync(pipe?: PipeAsync): BigintSchemaAsync; /** * Creates an async bigint schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async bigint schema. */ export function bigintAsync( @@ -36,6 +40,7 @@ export function bigintAsync( /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns An async bigint schema. */ export function bigintAsync( @@ -59,8 +64,10 @@ export function bigintAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/blob/blob.ts b/library/src/schemas/blob/blob.ts index 2d6044502..2a5d6f497 100644 --- a/library/src/schemas/blob/blob.ts +++ b/library/src/schemas/blob/blob.ts @@ -14,15 +14,19 @@ export type BlobSchema = BaseSchema & { /** * Creates a blob schema. + * * @param pipe A validation and transformation pipe. + * * @returns A blob schema. */ export function blob(pipe?: Pipe): BlobSchema; /** * Creates a blob schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A blob schema. */ export function blob(error?: ErrorMessage, pipe?: Pipe): BlobSchema; @@ -30,6 +34,7 @@ export function blob(error?: ErrorMessage, pipe?: Pipe): BlobSchema; /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns A blob schema. */ export function blob( @@ -53,8 +58,10 @@ export function blob( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/blob/blobAsync.ts b/library/src/schemas/blob/blobAsync.ts index 427a4face..f8a388e2c 100644 --- a/library/src/schemas/blob/blobAsync.ts +++ b/library/src/schemas/blob/blobAsync.ts @@ -14,15 +14,19 @@ export type BlobSchemaAsync = BaseSchemaAsync & { /** * Creates an async blob schema. + * * @param pipe A validation and transformation pipe. + * * @returns An async blob schema. */ export function blobAsync(pipe?: PipeAsync): BlobSchemaAsync; /** * Creates an async blob schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async blob schema. */ export function blobAsync( @@ -33,6 +37,7 @@ export function blobAsync( /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns An async blob schema. */ export function blobAsync( @@ -56,8 +61,10 @@ export function blobAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/boolean/boolean.ts b/library/src/schemas/boolean/boolean.ts index 6f17c3150..294ce6bf7 100644 --- a/library/src/schemas/boolean/boolean.ts +++ b/library/src/schemas/boolean/boolean.ts @@ -14,15 +14,19 @@ export type BooleanSchema = BaseSchema & { /** * Creates a boolean schema. + * * @param pipe A validation and transformation pipe. + * * @returns A boolean schema. */ export function boolean(pipe?: Pipe): BooleanSchema; /** * Creates a boolean schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A boolean schema. */ export function boolean( @@ -33,6 +37,7 @@ export function boolean( /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns A boolean schema. */ export function boolean( @@ -56,8 +61,10 @@ export function boolean( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/boolean/booleanAsync.ts b/library/src/schemas/boolean/booleanAsync.ts index 7e2595e83..39663f562 100644 --- a/library/src/schemas/boolean/booleanAsync.ts +++ b/library/src/schemas/boolean/booleanAsync.ts @@ -17,15 +17,19 @@ export type BooleanSchemaAsync = BaseSchemaAsync< /** * Creates an async boolean schema. + * * @param pipe A validation and transformation pipe. + * * @returns An async boolean schema. */ export function booleanAsync(pipe?: PipeAsync): BooleanSchemaAsync; /** * Creates an async boolean schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async boolean schema. */ export function booleanAsync( @@ -36,6 +40,7 @@ export function booleanAsync( /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns An async boolean schema. */ export function booleanAsync( @@ -59,8 +64,10 @@ export function booleanAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/date/date.ts b/library/src/schemas/date/date.ts index c136b623e..6694475e2 100644 --- a/library/src/schemas/date/date.ts +++ b/library/src/schemas/date/date.ts @@ -14,15 +14,19 @@ export type DateSchema = BaseSchema & { /** * Creates a date schema. + * * @param pipe A validation and transformation pipe. + * * @returns A date schema. */ export function date(pipe?: Pipe): DateSchema; /** * Creates a date schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A date schema. */ export function date(error?: ErrorMessage, pipe?: Pipe): DateSchema; @@ -30,6 +34,7 @@ export function date(error?: ErrorMessage, pipe?: Pipe): DateSchema; /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns A date schema. */ export function date( @@ -53,8 +58,10 @@ export function date( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/date/dateAsync.ts b/library/src/schemas/date/dateAsync.ts index faaf91bb2..514bf7cb7 100644 --- a/library/src/schemas/date/dateAsync.ts +++ b/library/src/schemas/date/dateAsync.ts @@ -14,15 +14,19 @@ export type DateSchemaAsync = BaseSchemaAsync & { /** * Creates an async date schema. + * * @param pipe A validation and transformation pipe. + * * @returns An async date schema. */ export function dateAsync(pipe?: PipeAsync): DateSchemaAsync; /** * Creates an async date schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async date schema. */ export function dateAsync( @@ -33,6 +37,7 @@ export function dateAsync( /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns An async date schema. */ export function dateAsync( @@ -56,8 +61,10 @@ export function dateAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/enumType/enumType.ts b/library/src/schemas/enumType/enumType.ts index 1efad775e..7d4027266 100644 --- a/library/src/schemas/enumType/enumType.ts +++ b/library/src/schemas/enumType/enumType.ts @@ -15,8 +15,10 @@ export type EnumSchema< /** * Creates a enum schema. + * * @param enumValue The enum value. * @param error The error message. + * * @returns A enum schema. */ export function enumType>( @@ -41,8 +43,10 @@ export function enumType>( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/enumType/enumTypeAsync.ts b/library/src/schemas/enumType/enumTypeAsync.ts index 9a9e3798a..7e7f70d5e 100644 --- a/library/src/schemas/enumType/enumTypeAsync.ts +++ b/library/src/schemas/enumType/enumTypeAsync.ts @@ -15,8 +15,10 @@ export type EnumSchemaAsync< /** * Creates an async enum schema. + * * @param enumValue The enum value. * @param error The error message. + * * @returns An async enum schema. */ export function enumTypeAsync< @@ -41,8 +43,10 @@ export function enumTypeAsync< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/instance/instance.ts b/library/src/schemas/instance/instance.ts index 730daf91d..2b6f49e69 100644 --- a/library/src/schemas/instance/instance.ts +++ b/library/src/schemas/instance/instance.ts @@ -23,8 +23,10 @@ export type InstanceSchema< /** * Creates an instance schema. + * * @param of The class of the instance. * @param pipe A validation and transformation pipe. + * * @returns An instance schema. */ export function instance( @@ -34,9 +36,11 @@ export function instance( /** * Creates an instance schema. + * * @param of The class of the instance. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An instance schema. */ export function instance( @@ -49,6 +53,7 @@ export function instance( * @param of The class of the instance. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns An instance schema. */ export function instance( @@ -78,8 +83,10 @@ export function instance( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/instance/instanceAsync.ts b/library/src/schemas/instance/instanceAsync.ts index 28b511584..b647aac58 100644 --- a/library/src/schemas/instance/instanceAsync.ts +++ b/library/src/schemas/instance/instanceAsync.ts @@ -19,8 +19,10 @@ export type InstanceSchemaAsync< /** * Creates an async instance schema. + * * @param of The class of the instance. * @param pipe A validation and transformation pipe. + * * @returns An async instance schema. */ export function instanceAsync( @@ -30,9 +32,11 @@ export function instanceAsync( /** * Creates an async instance schema. + * * @param of The class of the instance. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async instance schema. */ export function instanceAsync( @@ -45,6 +49,7 @@ export function instanceAsync( * @param of The class of the instance. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns An async instance schema. */ export function instanceAsync( @@ -74,8 +79,10 @@ export function instanceAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/intersection/intersection.ts b/library/src/schemas/intersection/intersection.ts index 0a90db091..9a4c5b108 100644 --- a/library/src/schemas/intersection/intersection.ts +++ b/library/src/schemas/intersection/intersection.ts @@ -25,8 +25,10 @@ export type IntersectionSchema< /** * Creates an intersection schema. + * * @param intersection The intersection schema. * @param error The error message. + * * @returns An intersection schema. */ export function intersection( @@ -51,8 +53,10 @@ export function intersection( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/intersection/intersectionAsync.ts b/library/src/schemas/intersection/intersectionAsync.ts index 9a7105fe1..09d00fd4c 100644 --- a/library/src/schemas/intersection/intersectionAsync.ts +++ b/library/src/schemas/intersection/intersectionAsync.ts @@ -25,8 +25,10 @@ export type IntersectionSchemaAsync< /** * Creates an async intersection schema. + * * @param intersection The intersection schema. * @param error The error message. + * * @returns An async intersection schema. */ export function intersectionAsync< @@ -53,8 +55,10 @@ export function intersectionAsync< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/intersection/utils/mergeOutputs/mergeOutputs.ts b/library/src/schemas/intersection/utils/mergeOutputs/mergeOutputs.ts index 0905c0fe7..51382edae 100644 --- a/library/src/schemas/intersection/utils/mergeOutputs/mergeOutputs.ts +++ b/library/src/schemas/intersection/utils/mergeOutputs/mergeOutputs.ts @@ -2,8 +2,10 @@ import { getOutput } from '../../../../utils/index.ts'; /** * Merges two outputs into one single output. + * * @param output1 First output. * @param output2 Second output. + * * @returns The merged output. */ export function mergeOutputs( diff --git a/library/src/schemas/literal/literal.ts b/library/src/schemas/literal/literal.ts index 83aea20ef..afe725052 100644 --- a/library/src/schemas/literal/literal.ts +++ b/library/src/schemas/literal/literal.ts @@ -15,8 +15,10 @@ export type LiteralSchema< /** * Creates a literal schema. + * * @param literal The literal value. * @param error The error message. + * * @returns A literal schema. */ export function literal( @@ -41,8 +43,10 @@ export function literal( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/literal/literalAsync.ts b/library/src/schemas/literal/literalAsync.ts index ee45c544c..1fdb1fa6c 100644 --- a/library/src/schemas/literal/literalAsync.ts +++ b/library/src/schemas/literal/literalAsync.ts @@ -15,8 +15,10 @@ export type LiteralSchemaAsync< /** * Creates an async literal schema. + * * @param literal The literal value. * @param error The error message. + * * @returns An async literal schema. */ export function literalAsync( @@ -41,8 +43,10 @@ export function literalAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/map/map.ts b/library/src/schemas/map/map.ts index b7ffc470e..ac7e58f32 100644 --- a/library/src/schemas/map/map.ts +++ b/library/src/schemas/map/map.ts @@ -27,9 +27,11 @@ export type MapSchema< /** * Creates a map schema. + * * @param key The key schema. * @param value The value schema. * @param pipe A validation and transformation pipe. + * * @returns A map schema. */ export function map( @@ -40,10 +42,12 @@ export function map( /** * Creates a map schema. + * * @param key The key schema. * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A map schema. */ export function map( @@ -58,6 +62,7 @@ export function map( * @param value The value schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns A map schema. */ export function map( @@ -88,8 +93,10 @@ export function map( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/map/mapAsync.ts b/library/src/schemas/map/mapAsync.ts index 4b1e65945..53ba6fa3c 100644 --- a/library/src/schemas/map/mapAsync.ts +++ b/library/src/schemas/map/mapAsync.ts @@ -28,9 +28,11 @@ export type MapSchemaAsync< /** * Creates an async map schema. + * * @param key The key schema. * @param value The value schema. * @param pipe A validation and transformation pipe. + * * @returns An async map schema. */ export function mapAsync< @@ -44,10 +46,12 @@ export function mapAsync< /** * Creates an async map schema. + * * @param key The key schema. * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async map schema. */ export function mapAsync< @@ -65,6 +69,7 @@ export function mapAsync< * @param value The value schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An async map schema. */ export function mapAsync< @@ -98,8 +103,10 @@ export function mapAsync< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nan/nan.ts b/library/src/schemas/nan/nan.ts index c7c792b19..392cc622f 100644 --- a/library/src/schemas/nan/nan.ts +++ b/library/src/schemas/nan/nan.ts @@ -10,7 +10,9 @@ export type NanSchema = BaseSchema & { /** * Creates a NaN schema. + * * @param error The error message. + * * @returns A NaN schema. */ export function nan(error?: ErrorMessage): NanSchema { @@ -27,8 +29,10 @@ export function nan(error?: ErrorMessage): NanSchema { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nan/nanAsync.ts b/library/src/schemas/nan/nanAsync.ts index 8499e8296..399124057 100644 --- a/library/src/schemas/nan/nanAsync.ts +++ b/library/src/schemas/nan/nanAsync.ts @@ -13,7 +13,9 @@ export type NanSchemaAsync = BaseSchemaAsync< /** * Creates an async NaN schema. + * * @param error The error message. + * * @returns An async NaN schema. */ export function nanAsync(error?: ErrorMessage): NanSchemaAsync { @@ -30,8 +32,10 @@ export function nanAsync(error?: ErrorMessage): NanSchemaAsync { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nativeEnum/nativeEnum.ts b/library/src/schemas/nativeEnum/nativeEnum.ts index d35d35b44..a8677e569 100644 --- a/library/src/schemas/nativeEnum/nativeEnum.ts +++ b/library/src/schemas/nativeEnum/nativeEnum.ts @@ -22,8 +22,10 @@ export type NativeEnumSchema< /** * Creates a enum schema. + * * @param nativeEnum The native enum value. * @param error The error message. + * * @returns A enum schema. */ export function nativeEnum( @@ -48,8 +50,10 @@ export function nativeEnum( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nativeEnum/nativeEnumAsync.ts b/library/src/schemas/nativeEnum/nativeEnumAsync.ts index 9d03fd9b2..4e013eced 100644 --- a/library/src/schemas/nativeEnum/nativeEnumAsync.ts +++ b/library/src/schemas/nativeEnum/nativeEnumAsync.ts @@ -15,8 +15,10 @@ export type NativeEnumSchemaAsync< /** * Creates an async enum schema. + * * @param nativeEnum The native enum value. * @param error The error message. + * * @returns An async enum schema. */ export function nativeEnumAsync( @@ -41,8 +43,10 @@ export function nativeEnumAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/never/never.ts b/library/src/schemas/never/never.ts index 42de00dcf..b78b7e6ca 100644 --- a/library/src/schemas/never/never.ts +++ b/library/src/schemas/never/never.ts @@ -10,7 +10,9 @@ export type NeverSchema = BaseSchema & { /** * Creates a never schema. + * * @param error The error message. + * * @returns A never schema. */ export function never(error?: ErrorMessage): NeverSchema { @@ -27,8 +29,10 @@ export function never(error?: ErrorMessage): NeverSchema { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/never/neverAsync.ts b/library/src/schemas/never/neverAsync.ts index d00b9669f..a6ee452d1 100644 --- a/library/src/schemas/never/neverAsync.ts +++ b/library/src/schemas/never/neverAsync.ts @@ -10,7 +10,9 @@ export type NeverSchemaAsync = BaseSchemaAsync & { /** * Creates an async never schema. + * * @param error The error message. + * * @returns An async never schema. */ export function neverAsync(error?: ErrorMessage): NeverSchemaAsync { @@ -27,8 +29,10 @@ export function neverAsync(error?: ErrorMessage): NeverSchemaAsync { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nonNullable/nonNullable.ts b/library/src/schemas/nonNullable/nonNullable.ts index f26555a28..b378b0f2a 100644 --- a/library/src/schemas/nonNullable/nonNullable.ts +++ b/library/src/schemas/nonNullable/nonNullable.ts @@ -19,8 +19,10 @@ export type NonNullableSchema< /** * Creates a non nullable schema. + * * @param wrapped The wrapped schema. * @param error The error message. + * * @returns A non nullable schema. */ export function nonNullable( @@ -45,8 +47,10 @@ export function nonNullable( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nonNullable/nonNullableAsync.ts b/library/src/schemas/nonNullable/nonNullableAsync.ts index 0ef11e820..fb8308c40 100644 --- a/library/src/schemas/nonNullable/nonNullableAsync.ts +++ b/library/src/schemas/nonNullable/nonNullableAsync.ts @@ -21,8 +21,10 @@ export type NonNullableSchemaAsync< /** * Creates an async non nullable schema. + * * @param wrapped The wrapped schema. * @param error The error message. + * * @returns An async non nullable schema. */ export function nonNullableAsync( @@ -47,8 +49,10 @@ export function nonNullableAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nonNullish/nonNullish.ts b/library/src/schemas/nonNullish/nonNullish.ts index db2c8376b..87929d51d 100644 --- a/library/src/schemas/nonNullish/nonNullish.ts +++ b/library/src/schemas/nonNullish/nonNullish.ts @@ -19,8 +19,10 @@ export type NonNullishSchema< /** * Creates a non nullish schema. + * * @param wrapped The wrapped schema. * @param error The error message. + * * @returns A non nullish schema. */ export function nonNullish( @@ -45,8 +47,10 @@ export function nonNullish( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nonNullish/nonNullishAsync.ts b/library/src/schemas/nonNullish/nonNullishAsync.ts index 707ccca95..f237558f1 100644 --- a/library/src/schemas/nonNullish/nonNullishAsync.ts +++ b/library/src/schemas/nonNullish/nonNullishAsync.ts @@ -21,8 +21,10 @@ export type NonNullishSchemaAsync< /** * Creates an async non nullish schema. + * * @param wrapped The wrapped schema. * @param error The error message. + * * @returns An async non nullish schema. */ export function nonNullishAsync( @@ -47,8 +49,10 @@ export function nonNullishAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nonOptional/nonOptional.ts b/library/src/schemas/nonOptional/nonOptional.ts index c132d48e0..bffca36db 100644 --- a/library/src/schemas/nonOptional/nonOptional.ts +++ b/library/src/schemas/nonOptional/nonOptional.ts @@ -19,8 +19,10 @@ export type NonOptionalSchema< /** * Creates a non optional schema. + * * @param wrapped The wrapped schema. * @param error The error message. + * * @returns A non optional schema. */ export function nonOptional( @@ -45,8 +47,10 @@ export function nonOptional( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nonOptional/nonOptionalAsync.ts b/library/src/schemas/nonOptional/nonOptionalAsync.ts index 878f3d4b3..e35e1218e 100644 --- a/library/src/schemas/nonOptional/nonOptionalAsync.ts +++ b/library/src/schemas/nonOptional/nonOptionalAsync.ts @@ -21,8 +21,10 @@ export type NonOptionalSchemaAsync< /** * Creates an async non optional schema. + * * @param wrapped The wrapped schema. * @param error The error message. + * * @returns An async non optional schema. */ export function nonOptionalAsync( @@ -47,8 +49,10 @@ export function nonOptionalAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nullType/nullType.ts b/library/src/schemas/nullType/nullType.ts index 2deef8459..6c4a5db2b 100644 --- a/library/src/schemas/nullType/nullType.ts +++ b/library/src/schemas/nullType/nullType.ts @@ -10,7 +10,9 @@ export type NullSchema = BaseSchema & { /** * Creates a null schema. + * * @param error The error message. + * * @returns A null schema. */ export function nullType(error?: ErrorMessage): NullSchema { @@ -27,8 +29,10 @@ export function nullType(error?: ErrorMessage): NullSchema { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nullType/nullTypeAsync.ts b/library/src/schemas/nullType/nullTypeAsync.ts index e56e0a6c3..43316a0b6 100644 --- a/library/src/schemas/nullType/nullTypeAsync.ts +++ b/library/src/schemas/nullType/nullTypeAsync.ts @@ -10,7 +10,9 @@ export type NullSchemaAsync = BaseSchemaAsync & { /** * Creates an async null schema. + * * @param error The error message. + * * @returns An async null schema. */ export function nullTypeAsync(error?: ErrorMessage): NullSchemaAsync { @@ -27,8 +29,10 @@ export function nullTypeAsync(error?: ErrorMessage): NullSchemaAsync { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nullable/nullable.ts b/library/src/schemas/nullable/nullable.ts index 43f8459db..971707a2e 100644 --- a/library/src/schemas/nullable/nullable.ts +++ b/library/src/schemas/nullable/nullable.ts @@ -18,8 +18,10 @@ export type NullableSchema< /** * Creates a nullable schema. + * * @param wrapped The wrapped schema. * @param default_ The default value. + * * @returns A nullable schema. */ export function nullable< @@ -42,6 +44,7 @@ export function nullable< /** * The default value. + * * @returns The default value. */ get default() { @@ -57,8 +60,10 @@ export function nullable< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nullable/nullableAsync.ts b/library/src/schemas/nullable/nullableAsync.ts index b5ea3f534..38089f4a5 100644 --- a/library/src/schemas/nullable/nullableAsync.ts +++ b/library/src/schemas/nullable/nullableAsync.ts @@ -26,8 +26,10 @@ export type NullableSchemaAsync< /** * Creates an async nullable schema. + * * @param wrapped The wrapped schema. * @param default_ The default value. + * * @returns An async nullable schema. */ export function nullableAsync< @@ -53,6 +55,7 @@ export function nullableAsync< /** * The default value. + * * @returns The default value. */ get default() { @@ -68,8 +71,10 @@ export function nullableAsync< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/nullish/nullish.ts b/library/src/schemas/nullish/nullish.ts index 55e42ca7d..4d5f01783 100644 --- a/library/src/schemas/nullish/nullish.ts +++ b/library/src/schemas/nullish/nullish.ts @@ -18,8 +18,10 @@ export type NullishSchema< /** * Creates a nullish schema. + * * @param wrapped The wrapped schema. * @param default_ The default value. + * * @returns A nullish schema. */ export function nullish< @@ -42,6 +44,7 @@ export function nullish< /** * The default value. + * * @returns The default value. */ get default() { @@ -57,8 +60,10 @@ export function nullish< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/nullish/nullishAsync.ts b/library/src/schemas/nullish/nullishAsync.ts index 17520a4e9..c6395351b 100644 --- a/library/src/schemas/nullish/nullishAsync.ts +++ b/library/src/schemas/nullish/nullishAsync.ts @@ -26,8 +26,10 @@ export type NullishSchemaAsync< /** * Creates an async nullish schema. + * * @param wrapped The wrapped schema. * @param default_ The default value. + * * @returns An async nullish schema. */ export function nullishAsync< @@ -53,6 +55,7 @@ export function nullishAsync< /** * The default value. + * * @returns The default value. */ get default() { @@ -68,8 +71,10 @@ export function nullishAsync< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/number/number.ts b/library/src/schemas/number/number.ts index 39447170e..cc51e8930 100644 --- a/library/src/schemas/number/number.ts +++ b/library/src/schemas/number/number.ts @@ -14,15 +14,19 @@ export type NumberSchema = BaseSchema & { /** * Creates a number schema. + * * @param pipe A validation and transformation pipe. + * * @returns A number schema. */ export function number(pipe?: Pipe): NumberSchema; /** * Creates a number schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A number schema. */ export function number(error?: ErrorMessage, pipe?: Pipe): NumberSchema; @@ -30,6 +34,7 @@ export function number(error?: ErrorMessage, pipe?: Pipe): NumberSchema; /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns A number schema. */ export function number( @@ -53,8 +58,10 @@ export function number( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/number/numberAsync.ts b/library/src/schemas/number/numberAsync.ts index cd8640d95..2dd7c4d12 100644 --- a/library/src/schemas/number/numberAsync.ts +++ b/library/src/schemas/number/numberAsync.ts @@ -17,15 +17,19 @@ export type NumberSchemaAsync = BaseSchemaAsync< /** * Creates an async number schema. + * * @param pipe A validation and transformation pipe. + * * @returns An async number schema. */ export function numberAsync(pipe?: PipeAsync): NumberSchemaAsync; /** * Creates an async number schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async number schema. */ export function numberAsync( @@ -36,6 +40,7 @@ export function numberAsync( /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns An async number schema. */ export function numberAsync( @@ -59,8 +64,10 @@ export function numberAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/object/object.ts b/library/src/schemas/object/object.ts index fc02dac7a..ee9697bac 100644 --- a/library/src/schemas/object/object.ts +++ b/library/src/schemas/object/object.ts @@ -25,8 +25,10 @@ export type ObjectSchema< /** * Creates an object schema. + * * @param object The object schema. * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function object( @@ -36,9 +38,11 @@ export function object( /** * Creates an object schema. + * * @param object The object schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An object schema. */ export function object( @@ -51,6 +55,7 @@ export function object( * @param object The object schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns An object schema. */ export function object( @@ -83,8 +88,10 @@ export function object( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/object/objectAsync.ts b/library/src/schemas/object/objectAsync.ts index a04811ae0..e072a8c68 100644 --- a/library/src/schemas/object/objectAsync.ts +++ b/library/src/schemas/object/objectAsync.ts @@ -34,8 +34,10 @@ export type ObjectSchemaAsync< /** * Creates an async object schema. + * * @param object The object schema. * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function objectAsync( @@ -45,9 +47,11 @@ export function objectAsync( /** * Creates an async object schema. + * * @param object The object schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async object schema. */ export function objectAsync( @@ -60,6 +64,7 @@ export function objectAsync( * @param object The object schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns An async object schema. */ export function objectAsync( @@ -92,8 +97,10 @@ export function objectAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/optional/optional.ts b/library/src/schemas/optional/optional.ts index 08cef97c9..aac70b9d7 100644 --- a/library/src/schemas/optional/optional.ts +++ b/library/src/schemas/optional/optional.ts @@ -18,8 +18,10 @@ export type OptionalSchema< /** * Creates a optional schema. + * * @param wrapped The wrapped schema. * @param default_ The default value. + * * @returns A optional schema. */ export function optional< @@ -42,6 +44,7 @@ export function optional< /** * The default value. + * * @returns The default value. */ get default() { @@ -57,8 +60,10 @@ export function optional< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/optional/optionalAsync.ts b/library/src/schemas/optional/optionalAsync.ts index fd93bb6d0..2160af99a 100644 --- a/library/src/schemas/optional/optionalAsync.ts +++ b/library/src/schemas/optional/optionalAsync.ts @@ -26,8 +26,10 @@ export type OptionalSchemaAsync< /** * Creates an async optional schema. + * * @param wrapped The wrapped schema. * @param default_ The default value. + * * @returns An async optional schema. */ export function optionalAsync< @@ -53,6 +55,7 @@ export function optionalAsync< /** * The default value. + * * @returns The default value. */ get default() { @@ -68,8 +71,10 @@ export function optionalAsync< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/record/record.ts b/library/src/schemas/record/record.ts index 2fc4bc96a..3748a3a6d 100644 --- a/library/src/schemas/record/record.ts +++ b/library/src/schemas/record/record.ts @@ -29,8 +29,10 @@ export type RecordSchema< /** * Creates a record schema. + * * @param value The value schema. * @param pipe A validation and transformation pipe. + * * @returns A record schema. */ export function record( @@ -40,9 +42,11 @@ export function record( /** * Creates a record schema. + * * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A record schema. */ export function record( @@ -53,9 +57,11 @@ export function record( /** * Creates a record schema. + * * @param key The key schema. * @param value The value schema. * @param pipe A validation and transformation pipe. + * * @returns A record schema. */ export function record< @@ -69,10 +75,12 @@ export function record< /** * Creates a record schema. + * * @param key The key schema. * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A record schema. */ export function record< @@ -90,6 +98,7 @@ export function record< * @param arg2 A validation and transformation pipe, or an error message, or the value schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns A record schema. */ export function record< @@ -130,8 +139,10 @@ export function record< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/record/recordAsync.ts b/library/src/schemas/record/recordAsync.ts index 3233b346c..038b98426 100644 --- a/library/src/schemas/record/recordAsync.ts +++ b/library/src/schemas/record/recordAsync.ts @@ -45,8 +45,10 @@ export type RecordSchemaAsync< /** * Creates an async record schema. + * * @param value The value schema. * @param pipe A validation and transformation pipe. + * * @returns An async record schema. */ export function recordAsync( @@ -56,9 +58,11 @@ export function recordAsync( /** * Creates an async record schema. + * * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async record schema. */ export function recordAsync( @@ -69,9 +73,11 @@ export function recordAsync( /** * Creates an async record schema. + * * @param key The key schema. * @param value The value schema. * @param pipe A validation and transformation pipe. + * * @returns An async record schema. */ export function recordAsync< @@ -85,10 +91,12 @@ export function recordAsync< /** * Creates an async record schema. + * * @param key The key schema. * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async record schema. */ export function recordAsync< @@ -106,6 +114,7 @@ export function recordAsync< * @param arg2 A validation and transformation pipe, or an error message, or the value schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An async record schema. */ export function recordAsync< @@ -146,8 +155,10 @@ export function recordAsync< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/record/utils/getRecordArgs/getRecordArgs.ts b/library/src/schemas/record/utils/getRecordArgs/getRecordArgs.ts index 756143a3f..28af310d8 100644 --- a/library/src/schemas/record/utils/getRecordArgs/getRecordArgs.ts +++ b/library/src/schemas/record/utils/getRecordArgs/getRecordArgs.ts @@ -12,10 +12,12 @@ import type { RecordKeyAsync } from '../../recordAsync.ts'; /** * Returns key, value, error and pipe from dynamic arguments. + * * @param arg1 First argument. * @param arg2 Second argument. * @param arg3 Third argument. * @param arg4 Fourth argument. + * * @returns The record arguments. */ export function getRecordArgs< diff --git a/library/src/schemas/recursive/recursive.ts b/library/src/schemas/recursive/recursive.ts index 129c73c99..547e34ea0 100644 --- a/library/src/schemas/recursive/recursive.ts +++ b/library/src/schemas/recursive/recursive.ts @@ -13,7 +13,9 @@ export type RecursiveSchema< /** * Creates a recursive schema. + * * @param getter The schema getter. + * * @returns A recursive schema. */ export function recursive BaseSchema>( @@ -37,8 +39,10 @@ export function recursive BaseSchema>( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/recursive/recursiveAsync.ts b/library/src/schemas/recursive/recursiveAsync.ts index 81d4dc659..f045ec307 100644 --- a/library/src/schemas/recursive/recursiveAsync.ts +++ b/library/src/schemas/recursive/recursiveAsync.ts @@ -18,7 +18,9 @@ export type RecursiveSchemaAsync< /** * Creates an async recursive schema. + * * @param getter The schema getter. + * * @returns An async recursive schema. */ export function recursiveAsync< @@ -42,8 +44,10 @@ export function recursiveAsync< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/set/set.ts b/library/src/schemas/set/set.ts index b393f7671..e661022a1 100644 --- a/library/src/schemas/set/set.ts +++ b/library/src/schemas/set/set.ts @@ -20,8 +20,10 @@ export type SetSchema< /** * Creates a set schema. + * * @param value The value schema. * @param pipe A validation and transformation pipe. + * * @returns A set schema. */ export function set( @@ -31,9 +33,11 @@ export function set( /** * Creates a set schema. + * * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A set schema. */ export function set( @@ -46,6 +50,7 @@ export function set( * @param value The value schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns A set schema. */ export function set( @@ -75,8 +80,10 @@ export function set( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/set/setAsync.ts b/library/src/schemas/set/setAsync.ts index f75a46e0a..d784b9f8a 100644 --- a/library/src/schemas/set/setAsync.ts +++ b/library/src/schemas/set/setAsync.ts @@ -26,8 +26,10 @@ export type SetSchemaAsync< /** * Creates an async set schema. + * * @param value The value schema. * @param pipe A validation and transformation pipe. + * * @returns An async set schema. */ export function setAsync( @@ -37,9 +39,11 @@ export function setAsync( /** * Creates an async set schema. + * * @param value The value schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async set schema. */ export function setAsync( @@ -52,6 +56,7 @@ export function setAsync( * @param value The value schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns An async set schema. */ export function setAsync( @@ -81,8 +86,10 @@ export function setAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/special/special.ts b/library/src/schemas/special/special.ts index c639a530b..eec166851 100644 --- a/library/src/schemas/special/special.ts +++ b/library/src/schemas/special/special.ts @@ -17,8 +17,10 @@ export type SpecialSchema = BaseSchema< /** * Creates a special schema. + * * @param check The type check function. * @param pipe A validation and transformation pipe. + * * @returns A special schema. */ export function special( @@ -28,9 +30,11 @@ export function special( /** * Creates a special schema. + * * @param check The type check function. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A special schema. */ export function special( @@ -43,6 +47,7 @@ export function special( * @param check The type check function. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns A special schema. */ export function special( @@ -67,8 +72,10 @@ export function special( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/special/specialAsync.ts b/library/src/schemas/special/specialAsync.ts index 0e691030b..5bcb5a509 100644 --- a/library/src/schemas/special/specialAsync.ts +++ b/library/src/schemas/special/specialAsync.ts @@ -17,8 +17,10 @@ export type SpecialSchemaAsync = BaseSchemaAsync< /** * Creates an async special schema. + * * @param check The type check function. * @param pipe A validation and transformation pipe. + * * @returns An async special schema. */ export function specialAsync( @@ -28,9 +30,11 @@ export function specialAsync( /** * Creates a special schema. + * * @param check The type check function. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async special schema. */ export function specialAsync( @@ -43,6 +47,7 @@ export function specialAsync( * @param check The type check function. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. + * * @returns An async special schema. */ export function specialAsync( @@ -67,8 +72,10 @@ export function specialAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/string/string.ts b/library/src/schemas/string/string.ts index e4abd1146..732a717f6 100644 --- a/library/src/schemas/string/string.ts +++ b/library/src/schemas/string/string.ts @@ -14,15 +14,19 @@ export type StringSchema = BaseSchema & { /** * Creates a string schema. + * * @param pipe A validation and transformation pipe. + * * @returns A string schema. */ export function string(pipe?: Pipe): StringSchema; /** * Creates a string schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A string schema. */ export function string(error?: ErrorMessage, pipe?: Pipe): StringSchema; @@ -30,6 +34,7 @@ export function string(error?: ErrorMessage, pipe?: Pipe): StringSchema; /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns A string schema. */ export function string( @@ -53,8 +58,10 @@ export function string( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/string/stringAsync.ts b/library/src/schemas/string/stringAsync.ts index 48fcd4116..8c58b8bc6 100644 --- a/library/src/schemas/string/stringAsync.ts +++ b/library/src/schemas/string/stringAsync.ts @@ -17,15 +17,19 @@ export type StringSchemaAsync = BaseSchemaAsync< /** * Creates an async string schema. + * * @param pipe A validation and transformation pipe. + * * @returns An async string schema. */ export function stringAsync(pipe?: PipeAsync): StringSchemaAsync; /** * Creates an async string schema. + * * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async string schema. */ export function stringAsync( @@ -36,6 +40,7 @@ export function stringAsync( /** * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. + * * @returns An async string schema. */ export function stringAsync( @@ -59,8 +64,10 @@ export function stringAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/symbol/symbol.ts b/library/src/schemas/symbol/symbol.ts index a396500f6..6f4b9c4a3 100644 --- a/library/src/schemas/symbol/symbol.ts +++ b/library/src/schemas/symbol/symbol.ts @@ -10,7 +10,9 @@ export type SymbolSchema = BaseSchema & { /** * Creates a symbol schema. + * * @param error The error message. + * * @returns A symbol schema. */ export function symbol(error?: ErrorMessage): SymbolSchema { @@ -27,8 +29,10 @@ export function symbol(error?: ErrorMessage): SymbolSchema { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/symbol/symbolAsync.ts b/library/src/schemas/symbol/symbolAsync.ts index b58ae6c3d..2c3487f29 100644 --- a/library/src/schemas/symbol/symbolAsync.ts +++ b/library/src/schemas/symbol/symbolAsync.ts @@ -13,7 +13,9 @@ export type SymbolSchemaAsync = BaseSchemaAsync< /** * Creates an async symbol schema. + * * @param error The error message. + * * @returns An async symbol schema. */ export function symbolAsync(error?: ErrorMessage): SymbolSchemaAsync { @@ -30,8 +32,10 @@ export function symbolAsync(error?: ErrorMessage): SymbolSchemaAsync { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/tuple/tuple.ts b/library/src/schemas/tuple/tuple.ts index d5bf0efa8..36a7a9e59 100644 --- a/library/src/schemas/tuple/tuple.ts +++ b/library/src/schemas/tuple/tuple.ts @@ -22,8 +22,10 @@ export type TupleSchema< /** * Creates a tuple schema. + * * @param items The items schema. * @param pipe A validation and transformation pipe. + * * @returns A tuple schema. */ export function tuple( @@ -33,9 +35,11 @@ export function tuple( /** * Creates a tuple schema. + * * @param items The items schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A tuple schema. */ export function tuple( @@ -46,9 +50,11 @@ export function tuple( /** * Creates a tuple schema. + * * @param items The items schema. * @param rest The rest schema. * @param pipe A validation and transformation pipe. + * * @returns A tuple schema. */ export function tuple< @@ -62,10 +68,12 @@ export function tuple< /** * Creates a tuple schema. + * * @param items The items schema. * @param rest The rest schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns A tuple schema. */ export function tuple< @@ -84,6 +92,7 @@ export function tuple< * @param arg2 A validation and transformation pipe, or an error message, or the rest schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns A tuple schema. */ export function tuple< @@ -120,8 +129,10 @@ export function tuple< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/tuple/tupleAsync.ts b/library/src/schemas/tuple/tupleAsync.ts index b884eafee..4248102ad 100644 --- a/library/src/schemas/tuple/tupleAsync.ts +++ b/library/src/schemas/tuple/tupleAsync.ts @@ -35,8 +35,10 @@ export type TupleSchemaAsync< /** * Creates an async tuple schema. + * * @param items The items schema. * @param pipe A validation and transformation pipe. + * * @returns An async tuple schema. */ export function tupleAsync( @@ -46,9 +48,11 @@ export function tupleAsync( /** * Creates an async tuple schema. + * * @param items The items schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async tuple schema. */ export function tupleAsync( @@ -59,9 +63,11 @@ export function tupleAsync( /** * Creates an async tuple schema. + * * @param items The items schema. * @param rest The rest schema. * @param pipe A validation and transformation pipe. + * * @returns An async tuple schema. */ export function tupleAsync< @@ -75,10 +81,12 @@ export function tupleAsync< /** * Creates an async tuple schema. + * * @param items The items schema. * @param rest The rest schema. * @param error The error message. * @param pipe A validation and transformation pipe. + * * @returns An async tuple schema. */ export function tupleAsync< @@ -96,6 +104,7 @@ export function tupleAsync< * @param arg2 A validation and transformation pipe, or an error message, or the rest schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. + * * @returns An async tuple schema. */ export function tupleAsync< @@ -135,8 +144,10 @@ export function tupleAsync< /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/tuple/utils/getTupleArgs/getTupleArgs.ts b/library/src/schemas/tuple/utils/getTupleArgs/getTupleArgs.ts index 90c7263c2..608a642a9 100644 --- a/library/src/schemas/tuple/utils/getTupleArgs/getTupleArgs.ts +++ b/library/src/schemas/tuple/utils/getTupleArgs/getTupleArgs.ts @@ -9,9 +9,11 @@ import { getDefaultArgs } from '../../../../utils/index.ts'; /** * Returns rest, error and pipe from dynamic arguments. + * * @param arg1 First argument. * @param arg2 Second argument. * @param arg3 Third argument. + * * @returns The tuple arguments. */ export function getTupleArgs< diff --git a/library/src/schemas/undefinedType/undefinedType.ts b/library/src/schemas/undefinedType/undefinedType.ts index cd6e94671..65277e26a 100644 --- a/library/src/schemas/undefinedType/undefinedType.ts +++ b/library/src/schemas/undefinedType/undefinedType.ts @@ -13,7 +13,9 @@ export type UndefinedSchema = BaseSchema< /** * Creates a undefined schema. + * * @param error The error message. + * * @returns A undefined schema. */ export function undefinedType(error?: ErrorMessage): UndefinedSchema { @@ -30,8 +32,10 @@ export function undefinedType(error?: ErrorMessage): UndefinedSchema { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/undefinedType/undefinedTypeAsync.ts b/library/src/schemas/undefinedType/undefinedTypeAsync.ts index 3167c8224..da4b40b15 100644 --- a/library/src/schemas/undefinedType/undefinedTypeAsync.ts +++ b/library/src/schemas/undefinedType/undefinedTypeAsync.ts @@ -13,7 +13,9 @@ export type UndefinedSchemaAsync = BaseSchemaAsync< /** * Creates an async undefined schema. + * * @param error The error message. + * * @returns An async undefined schema. */ export function undefinedTypeAsync(error?: ErrorMessage): UndefinedSchemaAsync { @@ -30,8 +32,10 @@ export function undefinedTypeAsync(error?: ErrorMessage): UndefinedSchemaAsync { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/union/union.ts b/library/src/schemas/union/union.ts index 0c8f96a43..45d814f6a 100644 --- a/library/src/schemas/union/union.ts +++ b/library/src/schemas/union/union.ts @@ -29,8 +29,10 @@ export type UnionSchema< /** * Creates a union schema. + * * @param union The union schema. * @param error The error message. + * * @returns A union schema. */ export function union( @@ -55,8 +57,10 @@ export function union( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/union/unionAsync.ts b/library/src/schemas/union/unionAsync.ts index 19d02416f..3a591db42 100644 --- a/library/src/schemas/union/unionAsync.ts +++ b/library/src/schemas/union/unionAsync.ts @@ -30,8 +30,10 @@ export type UnionSchemaAsync< /** * Creates an async union schema. + * * @param union The union schema. * @param error The error message. + * * @returns An async union schema. */ export function unionAsync( @@ -56,8 +58,10 @@ export function unionAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/unknown/unknown.ts b/library/src/schemas/unknown/unknown.ts index e523caa38..4bc76fdf1 100644 --- a/library/src/schemas/unknown/unknown.ts +++ b/library/src/schemas/unknown/unknown.ts @@ -10,7 +10,9 @@ export type UnknownSchema = BaseSchema & { /** * Creates a unknown schema. + * * @param pipe A validation and transformation pipe. + * * @returns A unknown schema. */ export function unknown(pipe: Pipe = []): UnknownSchema { @@ -27,8 +29,10 @@ export function unknown(pipe: Pipe = []): UnknownSchema { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/unknown/unknownAsync.ts b/library/src/schemas/unknown/unknownAsync.ts index f91593279..375b20ea2 100644 --- a/library/src/schemas/unknown/unknownAsync.ts +++ b/library/src/schemas/unknown/unknownAsync.ts @@ -13,7 +13,9 @@ export type UnknownSchemaAsync = BaseSchemaAsync< /** * Creates an async unknown schema. + * * @param pipe A validation and transformation pipe. + * * @returns An async unknown schema. */ export function unknownAsync( @@ -32,8 +34,10 @@ export function unknownAsync( /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/schemas/voidType/voidType.ts b/library/src/schemas/voidType/voidType.ts index a3e178f96..6f95474a6 100644 --- a/library/src/schemas/voidType/voidType.ts +++ b/library/src/schemas/voidType/voidType.ts @@ -10,7 +10,9 @@ export type VoidSchema = BaseSchema & { /** * Creates a void schema. + * * @param error The error message. + * * @returns A void schema. */ export function voidType(error?: ErrorMessage): VoidSchema { @@ -27,8 +29,10 @@ export function voidType(error?: ErrorMessage): VoidSchema { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ _parse(input, info) { diff --git a/library/src/schemas/voidType/voidTypeAsync.ts b/library/src/schemas/voidType/voidTypeAsync.ts index a408d6b51..e894afc9a 100644 --- a/library/src/schemas/voidType/voidTypeAsync.ts +++ b/library/src/schemas/voidType/voidTypeAsync.ts @@ -10,7 +10,9 @@ export type VoidSchemaAsync = BaseSchemaAsync & { /** * Creates an async void schema. + * * @param error The error message. + * * @returns An async void schema. */ export function voidTypeAsync(error?: ErrorMessage): VoidSchemaAsync { @@ -27,8 +29,10 @@ export function voidTypeAsync(error?: ErrorMessage): VoidSchemaAsync { /** * Parses unknown input based on its schema. + * * @param input The input to be parsed. * @param info The parse info. + * * @returns The parsed output. */ async _parse(input, info) { diff --git a/library/src/transformations/toCustom/toCustom.ts b/library/src/transformations/toCustom/toCustom.ts index 52647e862..1e8120e4c 100644 --- a/library/src/transformations/toCustom/toCustom.ts +++ b/library/src/transformations/toCustom/toCustom.ts @@ -3,7 +3,9 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates a custom transformation function. + * * @param action The transform action. + * * @returns A transformation function. */ export function toCustom(action: (input: TInput) => TInput) { diff --git a/library/src/transformations/toCustom/toCustomAsync.ts b/library/src/transformations/toCustom/toCustomAsync.ts index 5e1aa221f..476e3ed0d 100644 --- a/library/src/transformations/toCustom/toCustomAsync.ts +++ b/library/src/transformations/toCustom/toCustomAsync.ts @@ -2,7 +2,9 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a async custom transformation function. + * * @param action The transform action. + * * @returns A async transformation function. */ export function toCustomAsync( diff --git a/library/src/transformations/toLowerCase/toLowerCase.ts b/library/src/transformations/toLowerCase/toLowerCase.ts index 8b80fd9e3..01494600c 100644 --- a/library/src/transformations/toLowerCase/toLowerCase.ts +++ b/library/src/transformations/toLowerCase/toLowerCase.ts @@ -3,6 +3,7 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a transformation function that converts all the alphabetic * characters in a string to lowercase. + * * @returns A transformation function. */ export function toLowerCase() { diff --git a/library/src/transformations/toMaxValue/toMaxValue.ts b/library/src/transformations/toMaxValue/toMaxValue.ts index 8e96c0357..e60321a57 100644 --- a/library/src/transformations/toMaxValue/toMaxValue.ts +++ b/library/src/transformations/toMaxValue/toMaxValue.ts @@ -3,7 +3,9 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a transformation function that sets a string, number or date to a * maximum value. + * * @param requirement The maximum value. + * * @returns A transformation function. */ export function toMaxValue< diff --git a/library/src/transformations/toMinValue/toMinValue.ts b/library/src/transformations/toMinValue/toMinValue.ts index 4bc1b1f31..674db8f52 100644 --- a/library/src/transformations/toMinValue/toMinValue.ts +++ b/library/src/transformations/toMinValue/toMinValue.ts @@ -3,7 +3,9 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a transformation function that sets a string, number or date to a * minimum value. + * * @param requirement The minimum value. + * * @returns A transformation function. */ export function toMinValue< diff --git a/library/src/transformations/toTrimmed/toTrimmed.ts b/library/src/transformations/toTrimmed/toTrimmed.ts index c54eccaf5..4e54c5c7e 100644 --- a/library/src/transformations/toTrimmed/toTrimmed.ts +++ b/library/src/transformations/toTrimmed/toTrimmed.ts @@ -4,6 +4,7 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates a transformation function that removes the leading and trailing * white space and line terminator characters from a string. + * * @returns A transformation function. */ export function toTrimmed() { diff --git a/library/src/transformations/toTrimmedEnd/toTrimmedEnd.ts b/library/src/transformations/toTrimmedEnd/toTrimmedEnd.ts index a976777dd..ed2eaad65 100644 --- a/library/src/transformations/toTrimmedEnd/toTrimmedEnd.ts +++ b/library/src/transformations/toTrimmedEnd/toTrimmedEnd.ts @@ -4,6 +4,7 @@ import { getOutput } from '../../utils/index.ts'; /** * Creates a transformation function that removes the trailing white space and * line terminator characters from a string. + * * @returns A transformation function. */ export function toTrimmedEnd() { diff --git a/library/src/transformations/toTrimmedStart/toTrimmedStart.ts b/library/src/transformations/toTrimmedStart/toTrimmedStart.ts index dd8689c2f..8e264aa2d 100644 --- a/library/src/transformations/toTrimmedStart/toTrimmedStart.ts +++ b/library/src/transformations/toTrimmedStart/toTrimmedStart.ts @@ -3,6 +3,7 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a transformation function that removes the leading white space and * line terminator characters from a string. + * * @returns A transformation function. */ export function toTrimmedStart() { diff --git a/library/src/transformations/toUpperCase/toUpperCase.ts b/library/src/transformations/toUpperCase/toUpperCase.ts index ade6cfef8..aa431dee0 100644 --- a/library/src/transformations/toUpperCase/toUpperCase.ts +++ b/library/src/transformations/toUpperCase/toUpperCase.ts @@ -3,6 +3,7 @@ import type { PipeResult } from '../../types.ts'; /** * Creates a transformation function that converts all the alphabetic * characters in a string to uppercase. + * * @returns A transformation function. */ export function toUpperCase() { diff --git a/library/src/utils/executePipe/executePipe.ts b/library/src/utils/executePipe/executePipe.ts index 05c1d4388..0792e0d92 100644 --- a/library/src/utils/executePipe/executePipe.ts +++ b/library/src/utils/executePipe/executePipe.ts @@ -12,10 +12,12 @@ import { getIssue, getPipeInfo } from './utils/index.ts'; /** * Executes the validation and transformation pipe. + * * @param input The input value. * @param pipe The pipe to be executed. * @param parseInfo The parse info. * @param reason The issue reason. + * * @returns The output value. */ export function executePipe( diff --git a/library/src/utils/executePipe/executePipeAsync.ts b/library/src/utils/executePipe/executePipeAsync.ts index caba85efb..a18d7840f 100644 --- a/library/src/utils/executePipe/executePipeAsync.ts +++ b/library/src/utils/executePipe/executePipeAsync.ts @@ -12,10 +12,12 @@ import { getIssue, getPipeInfo } from './utils/index.ts'; /** * Executes the async validation and transformation pipe. + * * @param input The input value. * @param pipe The pipe to be executed. * @param parseInfo The parse info. * @param reason The issue reason. + * * @returns The output value. */ export async function executePipeAsync( diff --git a/library/src/utils/executePipe/utils/getIssue/getIssue.ts b/library/src/utils/executePipe/utils/getIssue/getIssue.ts index 0d56e308b..e8d1f4751 100644 --- a/library/src/utils/executePipe/utils/getIssue/getIssue.ts +++ b/library/src/utils/executePipe/utils/getIssue/getIssue.ts @@ -2,8 +2,10 @@ import type { Issue, PipeInfo } from '../../../../types.ts'; /** * Returns the final issue data. + * * @param info The pipe info. * @param issue The issue data. + * * @returns The issue data. */ export function getIssue( diff --git a/library/src/utils/executePipe/utils/getPipeInfo/getPipeInfo.ts b/library/src/utils/executePipe/utils/getPipeInfo/getPipeInfo.ts index 3927685c9..6fdb9c2f0 100644 --- a/library/src/utils/executePipe/utils/getPipeInfo/getPipeInfo.ts +++ b/library/src/utils/executePipe/utils/getPipeInfo/getPipeInfo.ts @@ -2,8 +2,10 @@ import type { IssueReason, ParseInfo, PipeInfo } from '../../../../types.ts'; /** * Returns the pipe info. + * * @param info The parse info. * @param reason The issue reason. + * * @returns The pipe info. */ export function getPipeInfo( diff --git a/library/src/utils/getDefaultArgs/getDefaultArgs.ts b/library/src/utils/getDefaultArgs/getDefaultArgs.ts index c6d456fe4..74d5b7584 100644 --- a/library/src/utils/getDefaultArgs/getDefaultArgs.ts +++ b/library/src/utils/getDefaultArgs/getDefaultArgs.ts @@ -2,8 +2,10 @@ import type { ErrorMessage, Pipe, PipeAsync } from '../../types.ts'; /** * Returns error and pipe from dynamic arguments. + * * @param arg1 First argument. * @param arg2 Second argument. + * * @returns The default arguments. */ export function getDefaultArgs | PipeAsync>( diff --git a/library/src/utils/getErrorMessage/getErrorMessage.ts b/library/src/utils/getErrorMessage/getErrorMessage.ts index 0ad6e41a3..6c6d67ee8 100644 --- a/library/src/utils/getErrorMessage/getErrorMessage.ts +++ b/library/src/utils/getErrorMessage/getErrorMessage.ts @@ -2,7 +2,9 @@ import type { ErrorMessage } from '../../types.ts'; /** * Returns the final string of the error message. + * * @param error The error message. + * * @returns The error message. */ export function getErrorMessage(error: ErrorMessage): string { diff --git a/library/src/utils/getIssues/getIssues.ts b/library/src/utils/getIssues/getIssues.ts index ef6f32f52..0fba2b18d 100644 --- a/library/src/utils/getIssues/getIssues.ts +++ b/library/src/utils/getIssues/getIssues.ts @@ -1,6 +1,8 @@ /** * Returns the result object with issues. + * * @param issues The issues. + * * @returns The result object. */ export function getIssues(issues: TIssues): { issues: TIssues } { diff --git a/library/src/utils/getOutput/getOutput.ts b/library/src/utils/getOutput/getOutput.ts index 822a03b4c..ce9ecb2b3 100644 --- a/library/src/utils/getOutput/getOutput.ts +++ b/library/src/utils/getOutput/getOutput.ts @@ -1,6 +1,8 @@ /** * Returns the result object with an output. + * * @param output The output value. + * * @returns The result object. */ export function getOutput(output: TOutput): { output: TOutput } { diff --git a/library/src/utils/getPipeIssues/getPipeIssues.ts b/library/src/utils/getPipeIssues/getPipeIssues.ts index ebaf5f359..711d7905b 100644 --- a/library/src/utils/getPipeIssues/getPipeIssues.ts +++ b/library/src/utils/getPipeIssues/getPipeIssues.ts @@ -4,9 +4,11 @@ import { getIssues } from '../getIssues/getIssues.ts'; /** * Returns the pipeline result object with issues. + * * @param validation The validation name. * @param error The error message. * @param input The input value. + * * @returns The pipeline result object. */ export function getPipeIssues( diff --git a/library/src/utils/getSchemaIssues/getSchemaIssues.ts b/library/src/utils/getSchemaIssues/getSchemaIssues.ts index b99e1229e..2a7aae459 100644 --- a/library/src/utils/getSchemaIssues/getSchemaIssues.ts +++ b/library/src/utils/getSchemaIssues/getSchemaIssues.ts @@ -8,12 +8,14 @@ import { getErrorMessage } from '../getErrorMessage/getErrorMessage.ts'; /** * Returns the schema result object with issues. + * * @param info The parse info. * @param reason The issue reason. * @param validation The validation name. * @param error The error message. * @param input The input value. * @param issues The sub issues. + * * @returns The schema result object. */ export function getSchemaIssues( diff --git a/library/src/utils/isLuhnAlgo/isLuhnAlgo.ts b/library/src/utils/isLuhnAlgo/isLuhnAlgo.ts index c4f4d4fa6..95da980be 100644 --- a/library/src/utils/isLuhnAlgo/isLuhnAlgo.ts +++ b/library/src/utils/isLuhnAlgo/isLuhnAlgo.ts @@ -1,6 +1,8 @@ /** * Checks whether a string with numbers corresponds to the luhn algorithm. + * * @param input The input to be checked. + * * @returns Whether input is valid. */ export function isLuhnAlgo(input: string) { diff --git a/library/src/validations/bytes/bytes.ts b/library/src/validations/bytes/bytes.ts index e0d381e0c..ddedf0b07 100644 --- a/library/src/validations/bytes/bytes.ts +++ b/library/src/validations/bytes/bytes.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the byte length of a string. + * * @param requirement The byte length. * @param error The error message. + * * @returns A validation function. */ export function bytes( diff --git a/library/src/validations/cuid2/cuid2.ts b/library/src/validations/cuid2/cuid2.ts index c0d8a5217..0e30229f0 100644 --- a/library/src/validations/cuid2/cuid2.ts +++ b/library/src/validations/cuid2/cuid2.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates a [cuid2](https://github.com/paralleldrive/cuid2#cuid2). + * * @param error The error message. + * * @returns A validation function. */ export function cuid2(error?: ErrorMessage) { diff --git a/library/src/validations/custom/custom.ts b/library/src/validations/custom/custom.ts index 80e246a1a..faa5e6800 100644 --- a/library/src/validations/custom/custom.ts +++ b/library/src/validations/custom/custom.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a custom validation function. + * * @param requirement The validation function. * @param error The error message. + * * @returns A validation function. */ export function custom( diff --git a/library/src/validations/custom/customAsync.ts b/library/src/validations/custom/customAsync.ts index ead0a9dcb..7b8047473 100644 --- a/library/src/validations/custom/customAsync.ts +++ b/library/src/validations/custom/customAsync.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a async custom validation function. + * * @param requirement The async validation function. * @param error The error message. + * * @returns A async validation function. */ export function customAsync( diff --git a/library/src/validations/email/email.ts b/library/src/validations/email/email.ts index 31fe04c05..0a541ad22 100644 --- a/library/src/validations/email/email.ts +++ b/library/src/validations/email/email.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates an email. + * * @param error The error message. + * * @returns A validation function. */ export function email(error?: ErrorMessage) { diff --git a/library/src/validations/emoji/emoji.ts b/library/src/validations/emoji/emoji.ts index 6d9addac6..83ade0a6b 100644 --- a/library/src/validations/emoji/emoji.ts +++ b/library/src/validations/emoji/emoji.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates an emoji. + * * @param error The error message. + * * @returns A validation function. */ export function emoji(error?: ErrorMessage) { diff --git a/library/src/validations/endsWith/endsWith.ts b/library/src/validations/endsWith/endsWith.ts index 1b5d83843..7b85ac066 100644 --- a/library/src/validations/endsWith/endsWith.ts +++ b/library/src/validations/endsWith/endsWith.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the end of a string. + * * @param requirement The end string. * @param error The error message. + * * @returns A validation function. */ export function endsWith( diff --git a/library/src/validations/equal/equal.ts b/library/src/validations/equal/equal.ts index 0e1881ec5..710f1a456 100644 --- a/library/src/validations/equal/equal.ts +++ b/library/src/validations/equal/equal.ts @@ -3,10 +3,13 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that checks the value for equality. - * @deprecated Function has been renamed to `value`. + * * @param requirement The required value. * @param error The error message. + * * @returns A validation function. + * + * @deprecated Function has been renamed to `value`. */ export function equal< TInput extends string | number | bigint | boolean, diff --git a/library/src/validations/excludes/excludes.ts b/library/src/validations/excludes/excludes.ts index 8ffe0bd04..a20140d78 100644 --- a/library/src/validations/excludes/excludes.ts +++ b/library/src/validations/excludes/excludes.ts @@ -13,8 +13,10 @@ export function excludes( /** * Creates a validation function that validates the content of a string or array. + * * @param requirement The content to be excluded. * @param error The error message. + * * @returns A validation function. */ export function excludes( diff --git a/library/src/validations/finite/finite.ts b/library/src/validations/finite/finite.ts index 158ae843c..01c68f390 100644 --- a/library/src/validations/finite/finite.ts +++ b/library/src/validations/finite/finite.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates whether a number is finite. + * * @param error The error message. + * * @returns A validation function. */ export function finite(error?: ErrorMessage) { diff --git a/library/src/validations/imei/imei.ts b/library/src/validations/imei/imei.ts index 254de3f04..47ea6718c 100644 --- a/library/src/validations/imei/imei.ts +++ b/library/src/validations/imei/imei.ts @@ -5,7 +5,9 @@ import { getOutput, getPipeIssues, isLuhnAlgo } from '../../utils/index.ts'; * Creates a validation function that validates an IMEI. * * Format: AA-BBBBBB-CCCCCC-D + * * @param error The error message. + * * @returns A validation function. */ export function imei(error?: ErrorMessage) { diff --git a/library/src/validations/includes/includes.ts b/library/src/validations/includes/includes.ts index d0149cc15..f8dd720ae 100644 --- a/library/src/validations/includes/includes.ts +++ b/library/src/validations/includes/includes.ts @@ -13,8 +13,10 @@ export function includes( /** * Creates a validation function that validates the content of a string or array. + * * @param requirement The content to be included. * @param error The error message. + * * @returns A validation function. */ export function includes( diff --git a/library/src/validations/integer/integer.ts b/library/src/validations/integer/integer.ts index 90544ab1b..10c4746c6 100644 --- a/library/src/validations/integer/integer.ts +++ b/library/src/validations/integer/integer.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates whether a number is an integer. + * * @param error The error message. + * * @returns A validation function. */ export function integer(error?: ErrorMessage) { diff --git a/library/src/validations/ip/ip.ts b/library/src/validations/ip/ip.ts index dd5f68bd1..a72efd5c0 100644 --- a/library/src/validations/ip/ip.ts +++ b/library/src/validations/ip/ip.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates an IP v4 or v6 address. + * * @param error The error message. + * * @returns A validation function. */ export function ip(error?: ErrorMessage) { diff --git a/library/src/validations/ipv4/ipv4.ts b/library/src/validations/ipv4/ipv4.ts index 678da0fc0..4559c3178 100644 --- a/library/src/validations/ipv4/ipv4.ts +++ b/library/src/validations/ipv4/ipv4.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates an IP v4 address. + * * @param error The error message. + * * @returns A validation function. */ export function ipv4(error?: ErrorMessage) { diff --git a/library/src/validations/ipv6/ipv6.ts b/library/src/validations/ipv6/ipv6.ts index bc0589ae1..5f15e97e3 100644 --- a/library/src/validations/ipv6/ipv6.ts +++ b/library/src/validations/ipv6/ipv6.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates an IP v6 address. + * * @param error The error message. + * * @returns A validation function. */ export function ipv6(error?: ErrorMessage) { diff --git a/library/src/validations/isoDate/isoDate.ts b/library/src/validations/isoDate/isoDate.ts index 72a281478..83a37402d 100644 --- a/library/src/validations/isoDate/isoDate.ts +++ b/library/src/validations/isoDate/isoDate.ts @@ -9,7 +9,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Hint: The regex used cannot validate the maximum number of days based on * year and month. For example, "2023-06-31" is valid although June has only * 30 days. + * * @param error The error message. + * * @returns A validation function. */ export function isoDate(error?: ErrorMessage) { diff --git a/library/src/validations/isoDateTime/isoDateTime.ts b/library/src/validations/isoDateTime/isoDateTime.ts index 7c6983bcb..5fe6081be 100644 --- a/library/src/validations/isoDateTime/isoDateTime.ts +++ b/library/src/validations/isoDateTime/isoDateTime.ts @@ -9,7 +9,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Hint: The regex used cannot validate the maximum number of days based on * year and month. For example, "2023-06-31T00:00" is valid although June has only * 30 days. + * * @param error The error message. + * * @returns A validation function. */ export function isoDateTime(error?: ErrorMessage) { diff --git a/library/src/validations/isoTime/isoTime.ts b/library/src/validations/isoTime/isoTime.ts index 7d539a161..68a0bc977 100644 --- a/library/src/validations/isoTime/isoTime.ts +++ b/library/src/validations/isoTime/isoTime.ts @@ -5,7 +5,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Creates a validation function that validates a time. * * Format: hh:mm + * * @param error The error message. + * * @returns A validation function. */ export function isoTime(error?: ErrorMessage) { diff --git a/library/src/validations/isoTimeSecond/isoTimeSecond.ts b/library/src/validations/isoTimeSecond/isoTimeSecond.ts index 4cb180aff..b65f66a3e 100644 --- a/library/src/validations/isoTimeSecond/isoTimeSecond.ts +++ b/library/src/validations/isoTimeSecond/isoTimeSecond.ts @@ -5,7 +5,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Creates a validation function that validates a time with seconds. * * Format: hh:mm:ss + * * @param error The error message. + * * @returns A validation function. */ export function isoTimeSecond(error?: ErrorMessage) { diff --git a/library/src/validations/isoTimestamp/isoTimestamp.ts b/library/src/validations/isoTimestamp/isoTimestamp.ts index bd3d7051a..10773d75c 100644 --- a/library/src/validations/isoTimestamp/isoTimestamp.ts +++ b/library/src/validations/isoTimestamp/isoTimestamp.ts @@ -9,7 +9,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Hint: The regex used cannot validate the maximum number of days based on * year and month. For example, "2023-06-31T00:00:00.000Z" is valid although * June has only 30 days. + * * @param error The error message. + * * @returns A validation function. */ export function isoTimestamp(error?: ErrorMessage) { diff --git a/library/src/validations/isoWeek/isoWeek.ts b/library/src/validations/isoWeek/isoWeek.ts index c5803f836..222096c57 100644 --- a/library/src/validations/isoWeek/isoWeek.ts +++ b/library/src/validations/isoWeek/isoWeek.ts @@ -9,7 +9,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * Hint: The regex used cannot validate the maximum number of weeks based on * the year. For example, "2021W53" is valid even though the year 2021 has only * 52 weeks. + * * @param error The error message. + * * @returns A validation function. */ export function isoWeek(error?: ErrorMessage) { diff --git a/library/src/validations/length/length.ts b/library/src/validations/length/length.ts index 1e8ed0f2f..4456276de 100644 --- a/library/src/validations/length/length.ts +++ b/library/src/validations/length/length.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the length of a string or array. + * * @param requirement The length. * @param error The error message. + * * @returns A validation function. */ export function length( diff --git a/library/src/validations/maxBytes/maxBytes.ts b/library/src/validations/maxBytes/maxBytes.ts index dbb18e255..fd3d27c54 100644 --- a/library/src/validations/maxBytes/maxBytes.ts +++ b/library/src/validations/maxBytes/maxBytes.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the byte length of a string. + * * @param requirement The maximum length in byte. * @param error The error message. + * * @returns A validation function. */ export function maxBytes( diff --git a/library/src/validations/maxLength/maxLength.ts b/library/src/validations/maxLength/maxLength.ts index fd9f47726..2fd50ae1c 100644 --- a/library/src/validations/maxLength/maxLength.ts +++ b/library/src/validations/maxLength/maxLength.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the length of a string or array. + * * @param requirement The maximum length. * @param error The error message. + * * @returns A validation function. */ export function maxLength( diff --git a/library/src/validations/maxSize/maxSize.ts b/library/src/validations/maxSize/maxSize.ts index 2fc76faca..7909043ac 100644 --- a/library/src/validations/maxSize/maxSize.ts +++ b/library/src/validations/maxSize/maxSize.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the size of a map, set or blob. + * * @param requirement The maximum size. * @param error The error message. + * * @returns A validation function. */ export function maxSize | Set | Blob>( diff --git a/library/src/validations/maxValue/maxValue.ts b/library/src/validations/maxValue/maxValue.ts index 9db1410f7..5d3374f82 100644 --- a/library/src/validations/maxValue/maxValue.ts +++ b/library/src/validations/maxValue/maxValue.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the value of a string, number or date. + * * @param requirement The maximum value. * @param error The error message. + * * @returns A validation function. */ export function maxValue< @@ -19,6 +21,7 @@ export function maxValue< /** * See {@link maxValue} + * * @deprecated Function has been renamed to `maxValue`. */ export const maxRange = maxValue; diff --git a/library/src/validations/mimeType/mimeType.ts b/library/src/validations/mimeType/mimeType.ts index feb50e08e..37ac54076 100644 --- a/library/src/validations/mimeType/mimeType.ts +++ b/library/src/validations/mimeType/mimeType.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the MIME type of a file. + * * @param requirement The MIME types. * @param error The error message. + * * @returns A validation function. */ export function mimeType( diff --git a/library/src/validations/minBytes/minBytes.ts b/library/src/validations/minBytes/minBytes.ts index c136b7931..3aa80d392 100644 --- a/library/src/validations/minBytes/minBytes.ts +++ b/library/src/validations/minBytes/minBytes.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the byte length of a string. + * * @param requirement The minimum length in byte. * @param error The error message. + * * @returns A validation function. */ export function minBytes( diff --git a/library/src/validations/minLength/minLength.ts b/library/src/validations/minLength/minLength.ts index 326e46d22..5945d06bb 100644 --- a/library/src/validations/minLength/minLength.ts +++ b/library/src/validations/minLength/minLength.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the length of a string or array. + * * @param requirement The minimum length. * @param error The error message. + * * @returns A validation function. */ export function minLength( diff --git a/library/src/validations/minSize/minSize.ts b/library/src/validations/minSize/minSize.ts index 4e6c8425b..90d88f4f0 100644 --- a/library/src/validations/minSize/minSize.ts +++ b/library/src/validations/minSize/minSize.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the size of a map, set or blob. + * * @param requirement The minimum size. * @param error The error message. + * * @returns A validation function. */ export function minSize | Set | Blob>( diff --git a/library/src/validations/minValue/minValue.ts b/library/src/validations/minValue/minValue.ts index 2e4dc5eb1..783acfc26 100644 --- a/library/src/validations/minValue/minValue.ts +++ b/library/src/validations/minValue/minValue.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the value of a string, number or date. + * * @param requirement The minimum value. * @param error The error message. + * * @returns A validation function. */ export function minValue< @@ -19,6 +21,7 @@ export function minValue< /** * See {@link minValue} + * * @deprecated Function has been renamed to `minValue`. */ export const minRange = minValue; diff --git a/library/src/validations/multipleOf/multipleOf.ts b/library/src/validations/multipleOf/multipleOf.ts index 114fa4d06..7f3fd7679 100644 --- a/library/src/validations/multipleOf/multipleOf.ts +++ b/library/src/validations/multipleOf/multipleOf.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates whether a number is a multiple. + * * @param requirement The divisor. * @param error The error message. + * * @returns A validation function. */ export function multipleOf( diff --git a/library/src/validations/notBytes/notBytes.ts b/library/src/validations/notBytes/notBytes.ts index 545ebcb06..c681537f0 100644 --- a/library/src/validations/notBytes/notBytes.ts +++ b/library/src/validations/notBytes/notBytes.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the byte length of a string. + * * @param requirement The byte length. * @param error The error message. + * * @returns A validation function. */ export function notBytes( diff --git a/library/src/validations/notLength/notLength.ts b/library/src/validations/notLength/notLength.ts index 370c8cbf9..f69decc22 100644 --- a/library/src/validations/notLength/notLength.ts +++ b/library/src/validations/notLength/notLength.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the length of a string or array. + * * @param requirement The length. * @param error The error message. + * * @returns A validation function. */ export function notLength( diff --git a/library/src/validations/notSize/notSize.ts b/library/src/validations/notSize/notSize.ts index 076a87c18..19340db8e 100644 --- a/library/src/validations/notSize/notSize.ts +++ b/library/src/validations/notSize/notSize.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the size of a map, set or blob. + * * @param requirement The size. * @param error The error message. + * * @returns A validation function. */ export function notSize | Set | Blob>( diff --git a/library/src/validations/notValue/notValue.ts b/library/src/validations/notValue/notValue.ts index 13dcd9d21..9f7646f40 100644 --- a/library/src/validations/notValue/notValue.ts +++ b/library/src/validations/notValue/notValue.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the value of a string or number. + * * @param requirement The value. * @param error The error message. + * * @returns A validation function. */ export function notValue< diff --git a/library/src/validations/regex/regex.ts b/library/src/validations/regex/regex.ts index fd191e66b..f8ca829da 100644 --- a/library/src/validations/regex/regex.ts +++ b/library/src/validations/regex/regex.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates a string with a regex. + * * @param requirement The regex pattern. * @param error The error message. + * * @returns A validation function. */ export function regex( diff --git a/library/src/validations/safeInteger/safeInteger.ts b/library/src/validations/safeInteger/safeInteger.ts index c8fb98e55..0cc3e2776 100644 --- a/library/src/validations/safeInteger/safeInteger.ts +++ b/library/src/validations/safeInteger/safeInteger.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates whether a number is a safe integer. + * * @param error The error message. + * * @returns A validation function. */ export function safeInteger(error?: ErrorMessage) { diff --git a/library/src/validations/size/size.ts b/library/src/validations/size/size.ts index d334a2c6a..87d53d357 100644 --- a/library/src/validations/size/size.ts +++ b/library/src/validations/size/size.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the size of a map, set or blob. + * * @param requirement The size. * @param error The error message. + * * @returns A validation function. */ export function size | Set | Blob>( diff --git a/library/src/validations/startsWith/startsWith.ts b/library/src/validations/startsWith/startsWith.ts index 4bd780c16..b9dca2475 100644 --- a/library/src/validations/startsWith/startsWith.ts +++ b/library/src/validations/startsWith/startsWith.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the start of a string. + * * @param requirement The start string. * @param error The error message. + * * @returns A validation function. */ export function startsWith( diff --git a/library/src/validations/ulid/ulid.ts b/library/src/validations/ulid/ulid.ts index bc4290854..395470f20 100644 --- a/library/src/validations/ulid/ulid.ts +++ b/library/src/validations/ulid/ulid.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates a [ULID](https://github.com/ulid/spec). + * * @param error The error message. + * * @returns A validation function. */ export function ulid(error?: ErrorMessage) { diff --git a/library/src/validations/url/url.ts b/library/src/validations/url/url.ts index 807a81ae1..f3a4081cb 100644 --- a/library/src/validations/url/url.ts +++ b/library/src/validations/url/url.ts @@ -6,7 +6,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; * * Hint: The value is passed to the URL constructor to check if it is valid. * This check is not perfect. For example, values like "abc:1234" are accepted. + * * @param error The error message. + * * @returns A validation function. */ export function url(error?: ErrorMessage) { diff --git a/library/src/validations/uuid/uuid.ts b/library/src/validations/uuid/uuid.ts index b75ce1fca..9e683705c 100644 --- a/library/src/validations/uuid/uuid.ts +++ b/library/src/validations/uuid/uuid.ts @@ -3,7 +3,9 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates a UUID. + * * @param error The error message. + * * @returns A validation function. */ export function uuid(error?: ErrorMessage) { diff --git a/library/src/validations/value/value.ts b/library/src/validations/value/value.ts index 41db4b3a8..611bed68a 100644 --- a/library/src/validations/value/value.ts +++ b/library/src/validations/value/value.ts @@ -3,8 +3,10 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that validates the value of a string or number. + * * @param requirement The value. * @param error The error message. + * * @returns A validation function. */ export function value< From 76ffe2ecbd1b8ae80fead75fb3a18a6cb7823aee Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Mon, 9 Oct 2023 16:22:51 +0900 Subject: [PATCH 05/13] docs: delete duplicated overloaded functions docs --- library/src/error/flatten/flatten.ts | 14 ------- library/src/methods/merge/merge.ts | 22 ++--------- library/src/methods/merge/mergeAsync.ts | 21 +--------- library/src/methods/omit/omit.ts | 23 +---------- library/src/methods/omit/omitAsync.ts | 23 +---------- library/src/methods/partial/partial.ts | 21 +--------- library/src/methods/partial/partialAsync.ts | 21 +--------- library/src/methods/pick/pick.ts | 23 +---------- library/src/methods/pick/pickAsync.ts | 23 +---------- library/src/methods/required/required.ts | 21 +--------- library/src/methods/required/requiredAsync.ts | 22 ++--------- library/src/schemas/array/array.ts | 19 +--------- library/src/schemas/array/arrayAsync.ts | 19 +--------- library/src/schemas/bigint/bigint.ts | 17 +-------- library/src/schemas/bigint/bigintAsync.ts | 17 +-------- library/src/schemas/blob/blob.ts | 17 +-------- library/src/schemas/blob/blobAsync.ts | 17 +-------- library/src/schemas/boolean/boolean.ts | 17 +-------- library/src/schemas/boolean/booleanAsync.ts | 17 +-------- library/src/schemas/date/date.ts | 17 +-------- library/src/schemas/date/dateAsync.ts | 17 +-------- library/src/schemas/instance/instance.ts | 19 +--------- library/src/schemas/instance/instanceAsync.ts | 19 +--------- library/src/schemas/map/map.ts | 21 +--------- library/src/schemas/map/mapAsync.ts | 21 +--------- library/src/schemas/number/number.ts | 17 +-------- library/src/schemas/number/numberAsync.ts | 17 +-------- library/src/schemas/object/object.ts | 19 +--------- library/src/schemas/object/objectAsync.ts | 19 +--------- library/src/schemas/record/record.ts | 38 +------------------ library/src/schemas/record/recordAsync.ts | 38 +------------------ library/src/schemas/set/set.ts | 19 +--------- library/src/schemas/set/setAsync.ts | 19 +--------- library/src/schemas/special/special.ts | 19 +--------- library/src/schemas/special/specialAsync.ts | 19 +--------- library/src/schemas/string/string.ts | 17 +-------- library/src/schemas/string/stringAsync.ts | 17 +-------- library/src/schemas/tuple/tuple.ts | 37 +----------------- library/src/schemas/tuple/tupleAsync.ts | 38 +------------------ 39 files changed, 77 insertions(+), 744 deletions(-) diff --git a/library/src/error/flatten/flatten.ts b/library/src/error/flatten/flatten.ts index 07519232b..e0c1bdd68 100644 --- a/library/src/error/flatten/flatten.ts +++ b/library/src/error/flatten/flatten.ts @@ -123,24 +123,10 @@ export type FlatErrors = { nested: Partial, [string, ...string[]]>>; }; -/** - * Flatten the error messages of a Vali error. - * - * @param error A Vali error. - * - * @returns Flat errors. - */ export function flatten( error: ValiError ): FlatErrors; -/** - * Flatten the error messages of issues. - * - * @param issues The issues. - * - * @returns Flat errors. - */ export function flatten( issues: Issues ): FlatErrors; diff --git a/library/src/methods/merge/merge.ts b/library/src/methods/merge/merge.ts index 5957ac743..4edb59124 100644 --- a/library/src/methods/merge/merge.ts +++ b/library/src/methods/merge/merge.ts @@ -16,30 +16,11 @@ type ObjectSchemas = [ ...ObjectSchema[] ]; -/** - * Merges multiple object schemas into a single one. Subsequent object schemas - * overwrite the previous ones. - * - * @param schemas The schemas to be merged. - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function merge( schemas: TObjectSchemas, pipe?: Pipe>> ): ObjectSchema>; -/** - * Merges multiple object schemas into a single one. Subsequent object schemas - * overwrite the previous ones. - * - * @param schemas The schemas to be merged. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function merge( schemas: TObjectSchemas, error?: ErrorMessage, @@ -47,6 +28,9 @@ export function merge( ): ObjectSchema>; /** + * Merges multiple object schemas into a single one. Subsequent object schemas + * overwrite the previous ones. + * * @param schemas The schemas to be merged. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/methods/merge/mergeAsync.ts b/library/src/methods/merge/mergeAsync.ts index cab4c4236..67c17d779 100644 --- a/library/src/methods/merge/mergeAsync.ts +++ b/library/src/methods/merge/mergeAsync.ts @@ -17,30 +17,11 @@ type ObjectSchemas = [ ...(ObjectSchema | ObjectSchemaAsync)[] ]; -/** - * Merges multiple async object schemas into a single one. Subsequent object - * schemas overwrite the previous ones. - * - * @param schemas The schemas to be merged. - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function mergeAsync( schemas: TObjectSchemas, pipe?: PipeAsync>> ): ObjectSchemaAsync>; -/** - * Merges multiple async object schemas into a single one. Subsequent object - * schemas overwrite the previous ones. - * - * @param schemas The schemas to be merged. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function mergeAsync( schemas: TObjectSchemas, error?: ErrorMessage, @@ -48,6 +29,8 @@ export function mergeAsync( ): ObjectSchemaAsync>; /** + * Merges multiple async object schemas into a single one. Subsequent object + * schemas overwrite the previous ones. * * @param schemas The schemas to be merged. * @param arg2 A validation and transformation pipe, or an error message. diff --git a/library/src/methods/omit/omit.ts b/library/src/methods/omit/omit.ts index f75beb167..20a822148 100644 --- a/library/src/methods/omit/omit.ts +++ b/library/src/methods/omit/omit.ts @@ -7,16 +7,6 @@ import type { ErrorMessage, Pipe } from '../../types.ts'; import { getDefaultArgs } from '../../utils/index.ts'; import type { ObjectKeys } from './types.ts'; -/** - * Creates an object schema that contains not the selected keys of an existing - * schema. - * - * @param schema The schema to omit from. - * @param keys The selected keys - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function omit< TObjectSchema extends ObjectSchema, TKeys extends ObjectKeys @@ -26,17 +16,6 @@ export function omit< pipe?: Pipe>> ): ObjectSchema>; -/** - * Creates an object schema that contains not the selected keys of an existing - * schema. - * - * @param schema The schema to omit from. - * @param keys The selected keys - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function omit< TObjectSchema extends ObjectSchema, TKeys extends ObjectKeys @@ -48,6 +27,8 @@ export function omit< ): ObjectSchema>; /** + * Creates an object schema that contains not the selected keys of an existing + * schema. * * @param schema The schema to omit from. * @param keys The selected keys diff --git a/library/src/methods/omit/omitAsync.ts b/library/src/methods/omit/omitAsync.ts index 9f6cf8104..e0d421fb3 100644 --- a/library/src/methods/omit/omitAsync.ts +++ b/library/src/methods/omit/omitAsync.ts @@ -8,16 +8,6 @@ import type { ErrorMessage, PipeAsync } from '../../types.ts'; import { getDefaultArgs } from '../../utils/index.ts'; import type { ObjectKeys } from './types.ts'; -/** - * Creates an async object schema that contains only the selected keys of an - * existing schema. - * - * @param schema The schema to omit from. - * @param keys The selected keys - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function omitAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends ObjectKeys @@ -27,17 +17,6 @@ export function omitAsync< pipe?: PipeAsync>> ): ObjectSchemaAsync>; -/** - * Creates an async object schema that contains only the selected keys of an - * existing schema. - * - * @param schema The schema to omit from. - * @param keys The selected keys - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function omitAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends ObjectKeys @@ -49,6 +28,8 @@ export function omitAsync< ): ObjectSchemaAsync>; /** + * Creates an async object schema that contains only the selected keys of an + * existing schema. * * @param schema The schema to omit from. * @param keys The selected keys diff --git a/library/src/methods/partial/partial.ts b/library/src/methods/partial/partial.ts index e47b0b6c5..7e458e4d6 100644 --- a/library/src/methods/partial/partial.ts +++ b/library/src/methods/partial/partial.ts @@ -16,30 +16,11 @@ type Partial = { [TKey in keyof TObjectShape]: OptionalSchema; }; -/** - * Creates an object schema consisting of all properties of an existing object - * schema set to optional. - * - * @param schema The affected schema. - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function partial>( schema: TObjectSchema, pipe?: Pipe>> ): ObjectSchema>; -/** - * Creates an object schema consisting of all properties of an existing object - * schema set to optional. - * - * @param schema The affected schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function partial>( schema: TObjectSchema, error?: ErrorMessage, @@ -47,6 +28,8 @@ export function partial>( ): ObjectSchema>; /** + * Creates an object schema consisting of all properties of an existing object + * schema set to optional. * * @param schema The affected schema. * @param arg3 A validation and transformation pipe, or an error message. diff --git a/library/src/methods/partial/partialAsync.ts b/library/src/methods/partial/partialAsync.ts index 8aa4228d4..20ff35398 100644 --- a/library/src/methods/partial/partialAsync.ts +++ b/library/src/methods/partial/partialAsync.ts @@ -17,15 +17,6 @@ type Partial = { [TKey in keyof TObjectShape]: OptionalSchemaAsync; }; -/** - * Creates an async object schema consisting of all properties of an existing - * object schema set to optional. - * - * @param schema The affected schema. - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function partialAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync >( @@ -33,16 +24,6 @@ export function partialAsync< pipe?: PipeAsync>> ): ObjectSchemaAsync>; -/** - * Creates an async object schema consisting of all properties of an existing - * object schema set to optional. - * - * @param schema The affected schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function partialAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync >( @@ -52,6 +33,8 @@ export function partialAsync< ): ObjectSchemaAsync>; /** + * Creates an async object schema consisting of all properties of an existing + * object schema set to optional. * * @param schema The affected schema. * @param arg3 A validation and transformation pipe, or an error message. diff --git a/library/src/methods/pick/pick.ts b/library/src/methods/pick/pick.ts index 853e5ee4e..1f6bcefa4 100644 --- a/library/src/methods/pick/pick.ts +++ b/library/src/methods/pick/pick.ts @@ -6,16 +6,6 @@ import { import type { ErrorMessage, Pipe } from '../../types.ts'; import { getDefaultArgs } from '../../utils/index.ts'; -/** - * Creates an object schema that contains only the selected keys of an existing - * schema. - * - * @param schema The schema to pick from. - * @param keys The selected keys - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function pick< TObjectSchema extends ObjectSchema, TKeys extends (keyof TObjectSchema['object'])[] @@ -25,17 +15,6 @@ export function pick< pipe?: Pipe>> ): ObjectSchema>; -/** - * Creates an object schema that contains only the selected keys of an existing - * schema. - * - * @param schema The schema to pick from. - * @param keys The selected keys - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function pick< TObjectSchema extends ObjectSchema, TKeys extends (keyof TObjectSchema['object'])[] @@ -47,6 +26,8 @@ export function pick< ): ObjectSchema>; /** + * Creates an object schema that contains only the selected keys of an existing + * schema. * * @param schema The schema to pick from. * @param keys The selected keys diff --git a/library/src/methods/pick/pickAsync.ts b/library/src/methods/pick/pickAsync.ts index 0f8181eba..531da24e0 100644 --- a/library/src/methods/pick/pickAsync.ts +++ b/library/src/methods/pick/pickAsync.ts @@ -7,16 +7,6 @@ import { import type { ErrorMessage, PipeAsync } from '../../types.ts'; import { getDefaultArgs } from '../../utils/index.ts'; -/** - * Creates an async object schema that contains only the selected keys of an - * existing schema. - * - * @param schema The schema to pick from. - * @param keys The selected keys - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function pickAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends (keyof TObjectSchema['object'])[] @@ -26,17 +16,6 @@ export function pickAsync< pipe?: PipeAsync>> ): ObjectSchemaAsync>; -/** - * Creates an async object schema that contains only the selected keys of an - * existing schema. - * - * @param schema The schema to pick from. - * @param keys The selected keys - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function pickAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends (keyof TObjectSchema['object'])[] @@ -48,6 +27,8 @@ export function pickAsync< ): ObjectSchemaAsync>; /** + * Creates an async object schema that contains only the selected keys of an + * existing schema. * * @param schema The schema to pick from. * @param keys The selected keys diff --git a/library/src/methods/required/required.ts b/library/src/methods/required/required.ts index 6339c475b..64ffc61f0 100644 --- a/library/src/methods/required/required.ts +++ b/library/src/methods/required/required.ts @@ -16,30 +16,11 @@ type Required = { [TKey in keyof TObjectShape]: NonOptionalSchema; }; -/** - * Creates an object schema consisting of all properties of an existing object - * schema set to none optional. - * - * @param schema The affected schema. - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function required>( schema: TObjectSchema, pipe?: Pipe>> ): ObjectSchema>; -/** - * Creates an object schema consisting of all properties of an existing object - * schema set to none optional. - * - * @param schema The affected schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function required>( schema: TObjectSchema, error?: ErrorMessage, @@ -47,6 +28,8 @@ export function required>( ): ObjectSchema>; /** + * Creates an object schema consisting of all properties of an existing object + * schema set to none optional. * * @param schema The affected schema. * @param arg3 A validation and transformation pipe, or an error message. diff --git a/library/src/methods/required/requiredAsync.ts b/library/src/methods/required/requiredAsync.ts index ca3024ec8..5d508eac8 100644 --- a/library/src/methods/required/requiredAsync.ts +++ b/library/src/methods/required/requiredAsync.ts @@ -17,15 +17,6 @@ type Required = { [TKey in keyof TObjectShape]: NonOptionalSchemaAsync; }; -/** - * Creates an async object schema consisting of all properties of an existing - * object schema set to none optional. - * - * @param schema The affected schema. - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function requiredAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync >( @@ -33,16 +24,6 @@ export function requiredAsync< pipe?: PipeAsync>> ): ObjectSchemaAsync>; -/** - * Creates an async object schema consisting of all properties of an existing - * object schema set to none optional. - * - * @param schema The affected schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function requiredAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync >( @@ -52,6 +33,9 @@ export function requiredAsync< ): ObjectSchemaAsync>; /** + * Creates an async object schema consisting of all properties of an existing + * object schema set to none optional. + * * @param schema The affected schema. * @param arg3 A validation and transformation pipe, or an error message. * @param arg4 A validation and transformation pipe. diff --git a/library/src/schemas/array/array.ts b/library/src/schemas/array/array.ts index f866f71de..567dde619 100644 --- a/library/src/schemas/array/array.ts +++ b/library/src/schemas/array/array.ts @@ -25,28 +25,11 @@ export type ArraySchema< array: { item: TArrayItem }; }; -/** - * Creates a array schema. - * - * @param item The item schema. - * @param pipe A validation and transformation pipe. - * - * @returns A array schema. - */ export function array( item: TArrayItem, pipe?: Pipe[]> ): ArraySchema; -/** - * Creates a array schema. - * - * @param item The item schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A array schema. - */ export function array( item: TArrayItem, error?: ErrorMessage, @@ -54,6 +37,8 @@ export function array( ): ArraySchema; /** + * Creates a array schema. + * * @param item The item schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/schemas/array/arrayAsync.ts b/library/src/schemas/array/arrayAsync.ts index 6f805c89e..746f60b30 100644 --- a/library/src/schemas/array/arrayAsync.ts +++ b/library/src/schemas/array/arrayAsync.ts @@ -26,28 +26,11 @@ export type ArraySchemaAsync< array: { item: TArrayItem }; }; -/** - * Creates an async array schema. - * - * @param item The item schema. - * @param pipe A validation and transformation pipe. - * - * @returns An async array schema. - */ export function arrayAsync( item: TArrayItem, pipe?: PipeAsync[]> ): ArraySchemaAsync; -/** - * Creates an async array schema. - * - * @param item The item schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async array schema. - */ export function arrayAsync( item: TArrayItem, error?: ErrorMessage, @@ -55,6 +38,8 @@ export function arrayAsync( ): ArraySchemaAsync; /** + * Creates an async array schema. + * * @param item The item schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/schemas/bigint/bigint.ts b/library/src/schemas/bigint/bigint.ts index e94c5f203..fb5e67364 100644 --- a/library/src/schemas/bigint/bigint.ts +++ b/library/src/schemas/bigint/bigint.ts @@ -12,26 +12,13 @@ export type BigintSchema = BaseSchema & { schema: 'bigint'; }; -/** - * Creates a bigint schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns A bigint schema. - */ export function bigint(pipe?: Pipe): BigintSchema; -/** - * Creates a bigint schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A bigint schema. - */ export function bigint(error?: ErrorMessage, pipe?: Pipe): BigintSchema; /** + * Creates a bigint schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/bigint/bigintAsync.ts b/library/src/schemas/bigint/bigintAsync.ts index 34732f9b6..8ea79dd4b 100644 --- a/library/src/schemas/bigint/bigintAsync.ts +++ b/library/src/schemas/bigint/bigintAsync.ts @@ -15,29 +15,16 @@ export type BigintSchemaAsync = BaseSchemaAsync< schema: 'bigint'; }; -/** - * Creates an async bigint schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns An async bigint schema. - */ export function bigintAsync(pipe?: PipeAsync): BigintSchemaAsync; -/** - * Creates an async bigint schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async bigint schema. - */ export function bigintAsync( error?: ErrorMessage, pipe?: PipeAsync ): BigintSchemaAsync; /** + * Creates an async bigint schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/blob/blob.ts b/library/src/schemas/blob/blob.ts index 2a5d6f497..ca84b4ab8 100644 --- a/library/src/schemas/blob/blob.ts +++ b/library/src/schemas/blob/blob.ts @@ -12,26 +12,13 @@ export type BlobSchema = BaseSchema & { schema: 'blob'; }; -/** - * Creates a blob schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns A blob schema. - */ export function blob(pipe?: Pipe): BlobSchema; -/** - * Creates a blob schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A blob schema. - */ export function blob(error?: ErrorMessage, pipe?: Pipe): BlobSchema; /** + * Creates a blob schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/blob/blobAsync.ts b/library/src/schemas/blob/blobAsync.ts index f8a388e2c..e54d4c221 100644 --- a/library/src/schemas/blob/blobAsync.ts +++ b/library/src/schemas/blob/blobAsync.ts @@ -12,29 +12,16 @@ export type BlobSchemaAsync = BaseSchemaAsync & { schema: 'blob'; }; -/** - * Creates an async blob schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns An async blob schema. - */ export function blobAsync(pipe?: PipeAsync): BlobSchemaAsync; -/** - * Creates an async blob schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async blob schema. - */ export function blobAsync( error?: ErrorMessage, pipe?: PipeAsync ): BlobSchemaAsync; /** + * Creates an async blob schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/boolean/boolean.ts b/library/src/schemas/boolean/boolean.ts index 294ce6bf7..81757c70a 100644 --- a/library/src/schemas/boolean/boolean.ts +++ b/library/src/schemas/boolean/boolean.ts @@ -12,29 +12,16 @@ export type BooleanSchema = BaseSchema & { schema: 'boolean'; }; -/** - * Creates a boolean schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns A boolean schema. - */ export function boolean(pipe?: Pipe): BooleanSchema; -/** - * Creates a boolean schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A boolean schema. - */ export function boolean( error?: ErrorMessage, pipe?: Pipe ): BooleanSchema; /** + * Creates a boolean schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/boolean/booleanAsync.ts b/library/src/schemas/boolean/booleanAsync.ts index 39663f562..7541b72fc 100644 --- a/library/src/schemas/boolean/booleanAsync.ts +++ b/library/src/schemas/boolean/booleanAsync.ts @@ -15,29 +15,16 @@ export type BooleanSchemaAsync = BaseSchemaAsync< schema: 'boolean'; }; -/** - * Creates an async boolean schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns An async boolean schema. - */ export function booleanAsync(pipe?: PipeAsync): BooleanSchemaAsync; -/** - * Creates an async boolean schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async boolean schema. - */ export function booleanAsync( error?: ErrorMessage, pipe?: PipeAsync ): BooleanSchemaAsync; /** + * Creates an async boolean schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/date/date.ts b/library/src/schemas/date/date.ts index 6694475e2..60ed38a8b 100644 --- a/library/src/schemas/date/date.ts +++ b/library/src/schemas/date/date.ts @@ -12,26 +12,13 @@ export type DateSchema = BaseSchema & { schema: 'date'; }; -/** - * Creates a date schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns A date schema. - */ export function date(pipe?: Pipe): DateSchema; -/** - * Creates a date schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A date schema. - */ export function date(error?: ErrorMessage, pipe?: Pipe): DateSchema; /** + * Creates a date schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/date/dateAsync.ts b/library/src/schemas/date/dateAsync.ts index 514bf7cb7..19a4032f2 100644 --- a/library/src/schemas/date/dateAsync.ts +++ b/library/src/schemas/date/dateAsync.ts @@ -12,29 +12,16 @@ export type DateSchemaAsync = BaseSchemaAsync & { schema: 'date'; }; -/** - * Creates an async date schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns An async date schema. - */ export function dateAsync(pipe?: PipeAsync): DateSchemaAsync; -/** - * Creates an async date schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async date schema. - */ export function dateAsync( error?: ErrorMessage, pipe?: PipeAsync ): DateSchemaAsync; /** + * Creates an async date schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/instance/instance.ts b/library/src/schemas/instance/instance.ts index 2b6f49e69..22c432197 100644 --- a/library/src/schemas/instance/instance.ts +++ b/library/src/schemas/instance/instance.ts @@ -21,28 +21,11 @@ export type InstanceSchema< class: TClass; }; -/** - * Creates an instance schema. - * - * @param of The class of the instance. - * @param pipe A validation and transformation pipe. - * - * @returns An instance schema. - */ export function instance( of: TClass, pipe?: Pipe> ): InstanceSchema; -/** - * Creates an instance schema. - * - * @param of The class of the instance. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An instance schema. - */ export function instance( of: TClass, error?: ErrorMessage, @@ -50,6 +33,8 @@ export function instance( ): InstanceSchema; /** + * Creates an instance schema. + * * @param of The class of the instance. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/schemas/instance/instanceAsync.ts b/library/src/schemas/instance/instanceAsync.ts index b647aac58..3f38fa0b7 100644 --- a/library/src/schemas/instance/instanceAsync.ts +++ b/library/src/schemas/instance/instanceAsync.ts @@ -17,28 +17,11 @@ export type InstanceSchemaAsync< class: TClass; }; -/** - * Creates an async instance schema. - * - * @param of The class of the instance. - * @param pipe A validation and transformation pipe. - * - * @returns An async instance schema. - */ export function instanceAsync( of: TClass, pipe?: PipeAsync> ): InstanceSchemaAsync; -/** - * Creates an async instance schema. - * - * @param of The class of the instance. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async instance schema. - */ export function instanceAsync( of: TClass, error?: ErrorMessage, @@ -46,6 +29,8 @@ export function instanceAsync( ): InstanceSchemaAsync; /** + * Creates an async instance schema. + * * @param of The class of the instance. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/schemas/map/map.ts b/library/src/schemas/map/map.ts index ac7e58f32..146a457e1 100644 --- a/library/src/schemas/map/map.ts +++ b/library/src/schemas/map/map.ts @@ -25,31 +25,12 @@ export type MapSchema< map: { key: TMapKey; value: TMapValue }; }; -/** - * Creates a map schema. - * - * @param key The key schema. - * @param value The value schema. - * @param pipe A validation and transformation pipe. - * - * @returns A map schema. - */ export function map( key: TMapKey, value: TMapValue, pipe?: Pipe> ): MapSchema; -/** - * Creates a map schema. - * - * @param key The key schema. - * @param value The value schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A map schema. - */ export function map( key: TMapKey, value: TMapValue, @@ -58,6 +39,8 @@ export function map( ): MapSchema; /** + * Creates a map schema. + * * @param key The key schema. * @param value The value schema. * @param arg3 A validation and transformation pipe, or an error message. diff --git a/library/src/schemas/map/mapAsync.ts b/library/src/schemas/map/mapAsync.ts index 53ba6fa3c..60b34f779 100644 --- a/library/src/schemas/map/mapAsync.ts +++ b/library/src/schemas/map/mapAsync.ts @@ -26,15 +26,6 @@ export type MapSchemaAsync< map: { key: TMapKey; value: TMapValue }; }; -/** - * Creates an async map schema. - * - * @param key The key schema. - * @param value The value schema. - * @param pipe A validation and transformation pipe. - * - * @returns An async map schema. - */ export function mapAsync< TMapKey extends BaseSchema | BaseSchemaAsync, TMapValue extends BaseSchema | BaseSchemaAsync @@ -44,16 +35,6 @@ export function mapAsync< pipe?: PipeAsync> ): MapSchemaAsync; -/** - * Creates an async map schema. - * - * @param key The key schema. - * @param value The value schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async map schema. - */ export function mapAsync< TMapKey extends BaseSchema | BaseSchemaAsync, TMapValue extends BaseSchema | BaseSchemaAsync @@ -65,6 +46,8 @@ export function mapAsync< ): MapSchemaAsync; /** + * Creates an async map schema. + * * @param key The key schema. * @param value The value schema. * @param arg3 A validation and transformation pipe, or an error message. diff --git a/library/src/schemas/number/number.ts b/library/src/schemas/number/number.ts index cc51e8930..75d207c27 100644 --- a/library/src/schemas/number/number.ts +++ b/library/src/schemas/number/number.ts @@ -12,26 +12,13 @@ export type NumberSchema = BaseSchema & { schema: 'number'; }; -/** - * Creates a number schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns A number schema. - */ export function number(pipe?: Pipe): NumberSchema; -/** - * Creates a number schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A number schema. - */ export function number(error?: ErrorMessage, pipe?: Pipe): NumberSchema; /** + * Creates a number schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/number/numberAsync.ts b/library/src/schemas/number/numberAsync.ts index 2dd7c4d12..487d4b5b9 100644 --- a/library/src/schemas/number/numberAsync.ts +++ b/library/src/schemas/number/numberAsync.ts @@ -15,29 +15,16 @@ export type NumberSchemaAsync = BaseSchemaAsync< schema: 'number'; }; -/** - * Creates an async number schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns An async number schema. - */ export function numberAsync(pipe?: PipeAsync): NumberSchemaAsync; -/** - * Creates an async number schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async number schema. - */ export function numberAsync( error?: ErrorMessage, pipe?: PipeAsync ): NumberSchemaAsync; /** + * Creates an async number schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/object/object.ts b/library/src/schemas/object/object.ts index ee9697bac..0a797fadf 100644 --- a/library/src/schemas/object/object.ts +++ b/library/src/schemas/object/object.ts @@ -23,28 +23,11 @@ export type ObjectSchema< object: TObjectShape; }; -/** - * Creates an object schema. - * - * @param object The object schema. - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function object( object: TObjectShape, pipe?: Pipe> ): ObjectSchema; -/** - * Creates an object schema. - * - * @param object The object schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An object schema. - */ export function object( object: TObjectShape, error?: ErrorMessage, @@ -52,6 +35,8 @@ export function object( ): ObjectSchema; /** + * Creates an object schema. + * * @param object The object schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/schemas/object/objectAsync.ts b/library/src/schemas/object/objectAsync.ts index e072a8c68..f5669afba 100644 --- a/library/src/schemas/object/objectAsync.ts +++ b/library/src/schemas/object/objectAsync.ts @@ -32,28 +32,11 @@ export type ObjectSchemaAsync< object: TObjectShape; }; -/** - * Creates an async object schema. - * - * @param object The object schema. - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function objectAsync( object: TObjectShape, pipe?: PipeAsync> ): ObjectSchemaAsync; -/** - * Creates an async object schema. - * - * @param object The object schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async object schema. - */ export function objectAsync( object: TObjectShape, error?: ErrorMessage, @@ -61,6 +44,8 @@ export function objectAsync( ): ObjectSchemaAsync; /** + * Creates an async object schema. + * * @param object The object schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/schemas/record/record.ts b/library/src/schemas/record/record.ts index 3748a3a6d..ce30df851 100644 --- a/library/src/schemas/record/record.ts +++ b/library/src/schemas/record/record.ts @@ -27,43 +27,17 @@ export type RecordSchema< record: { key: TRecordKey; value: TRecordValue }; }; -/** - * Creates a record schema. - * - * @param value The value schema. - * @param pipe A validation and transformation pipe. - * - * @returns A record schema. - */ export function record( value: TRecordValue, pipe?: Pipe> ): RecordSchema; -/** - * Creates a record schema. - * - * @param value The value schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A record schema. - */ export function record( value: TRecordValue, error?: ErrorMessage, pipe?: Pipe> ): RecordSchema; -/** - * Creates a record schema. - * - * @param key The key schema. - * @param value The value schema. - * @param pipe A validation and transformation pipe. - * - * @returns A record schema. - */ export function record< TRecordKey extends RecordKey, TRecordValue extends BaseSchema @@ -73,16 +47,6 @@ export function record< pipe?: Pipe> ): RecordSchema; -/** - * Creates a record schema. - * - * @param key The key schema. - * @param value The value schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A record schema. - */ export function record< TRecordKey extends RecordKey, TRecordValue extends BaseSchema @@ -94,6 +58,8 @@ export function record< ): RecordSchema; /** + * Creates a record schema. + * * @param arg1 The value or key schema. * @param arg2 A validation and transformation pipe, or an error message, or the value schema. * @param arg3 A validation and transformation pipe, or an error message. diff --git a/library/src/schemas/record/recordAsync.ts b/library/src/schemas/record/recordAsync.ts index 038b98426..44cbb983e 100644 --- a/library/src/schemas/record/recordAsync.ts +++ b/library/src/schemas/record/recordAsync.ts @@ -43,43 +43,17 @@ export type RecordSchemaAsync< record: { key: TRecordKey; value: TRecordValue }; }; -/** - * Creates an async record schema. - * - * @param value The value schema. - * @param pipe A validation and transformation pipe. - * - * @returns An async record schema. - */ export function recordAsync( value: TRecordValue, pipe?: PipeAsync> ): RecordSchemaAsync; -/** - * Creates an async record schema. - * - * @param value The value schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async record schema. - */ export function recordAsync( value: TRecordValue, error?: ErrorMessage, pipe?: PipeAsync> ): RecordSchemaAsync; -/** - * Creates an async record schema. - * - * @param key The key schema. - * @param value The value schema. - * @param pipe A validation and transformation pipe. - * - * @returns An async record schema. - */ export function recordAsync< TRecordKey extends RecordKeyAsync, TRecordValue extends BaseSchema | BaseSchemaAsync @@ -89,16 +63,6 @@ export function recordAsync< pipe?: PipeAsync> ): RecordSchemaAsync; -/** - * Creates an async record schema. - * - * @param key The key schema. - * @param value The value schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async record schema. - */ export function recordAsync< TRecordKey extends RecordKeyAsync, TRecordValue extends BaseSchema | BaseSchemaAsync @@ -110,6 +74,8 @@ export function recordAsync< ): RecordSchemaAsync; /** + * Creates an async record schema. + * * @param arg1 The value or key schema. * @param arg2 A validation and transformation pipe, or an error message, or the value schema. * @param arg3 A validation and transformation pipe, or an error message. diff --git a/library/src/schemas/set/set.ts b/library/src/schemas/set/set.ts index e661022a1..281fb12a5 100644 --- a/library/src/schemas/set/set.ts +++ b/library/src/schemas/set/set.ts @@ -18,28 +18,11 @@ export type SetSchema< set: { value: TSetValue }; }; -/** - * Creates a set schema. - * - * @param value The value schema. - * @param pipe A validation and transformation pipe. - * - * @returns A set schema. - */ export function set( value: TSetValue, pipe?: Pipe> ): SetSchema; -/** - * Creates a set schema. - * - * @param value The value schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A set schema. - */ export function set( value: TSetValue, error?: ErrorMessage, @@ -47,6 +30,8 @@ export function set( ): SetSchema; /** + * Creates a set schema. + * * @param value The value schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/schemas/set/setAsync.ts b/library/src/schemas/set/setAsync.ts index d784b9f8a..da2b76060 100644 --- a/library/src/schemas/set/setAsync.ts +++ b/library/src/schemas/set/setAsync.ts @@ -24,28 +24,11 @@ export type SetSchemaAsync< set: { value: TSetValue }; }; -/** - * Creates an async set schema. - * - * @param value The value schema. - * @param pipe A validation and transformation pipe. - * - * @returns An async set schema. - */ export function setAsync( value: TSetValue, pipe?: PipeAsync> ): SetSchemaAsync; -/** - * Creates an async set schema. - * - * @param value The value schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async set schema. - */ export function setAsync( value: TSetValue, error?: ErrorMessage, @@ -53,6 +36,8 @@ export function setAsync( ): SetSchemaAsync; /** + * Creates an async set schema. + * * @param value The value schema. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/schemas/special/special.ts b/library/src/schemas/special/special.ts index eec166851..2c2b0087b 100644 --- a/library/src/schemas/special/special.ts +++ b/library/src/schemas/special/special.ts @@ -15,28 +15,11 @@ export type SpecialSchema = BaseSchema< schema: 'special'; }; -/** - * Creates a special schema. - * - * @param check The type check function. - * @param pipe A validation and transformation pipe. - * - * @returns A special schema. - */ export function special( check: (input: unknown) => boolean, pipe?: Pipe ): SpecialSchema; -/** - * Creates a special schema. - * - * @param check The type check function. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A special schema. - */ export function special( check: (input: unknown) => boolean, error?: ErrorMessage, @@ -44,6 +27,8 @@ export function special( ): SpecialSchema; /** + * Creates a special schema. + * * @param check The type check function. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/schemas/special/specialAsync.ts b/library/src/schemas/special/specialAsync.ts index 5bcb5a509..f9cfd09c9 100644 --- a/library/src/schemas/special/specialAsync.ts +++ b/library/src/schemas/special/specialAsync.ts @@ -15,28 +15,11 @@ export type SpecialSchemaAsync = BaseSchemaAsync< schema: 'special'; }; -/** - * Creates an async special schema. - * - * @param check The type check function. - * @param pipe A validation and transformation pipe. - * - * @returns An async special schema. - */ export function specialAsync( check: (input: unknown) => boolean | Promise, pipe?: PipeAsync ): SpecialSchemaAsync; -/** - * Creates a special schema. - * - * @param check The type check function. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async special schema. - */ export function specialAsync( check: (input: unknown) => boolean | Promise, error?: ErrorMessage, @@ -44,6 +27,8 @@ export function specialAsync( ): SpecialSchemaAsync; /** + * Creates a special schema. + * * @param check The type check function. * @param arg2 A validation and transformation pipe, or an error message. * @param arg3 A validation and transformation pipe. diff --git a/library/src/schemas/string/string.ts b/library/src/schemas/string/string.ts index 732a717f6..9aa170955 100644 --- a/library/src/schemas/string/string.ts +++ b/library/src/schemas/string/string.ts @@ -12,26 +12,13 @@ export type StringSchema = BaseSchema & { schema: 'string'; }; -/** - * Creates a string schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns A string schema. - */ export function string(pipe?: Pipe): StringSchema; -/** - * Creates a string schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A string schema. - */ export function string(error?: ErrorMessage, pipe?: Pipe): StringSchema; /** + * Creates a string schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/string/stringAsync.ts b/library/src/schemas/string/stringAsync.ts index 8c58b8bc6..c3bf357cc 100644 --- a/library/src/schemas/string/stringAsync.ts +++ b/library/src/schemas/string/stringAsync.ts @@ -15,29 +15,16 @@ export type StringSchemaAsync = BaseSchemaAsync< schema: 'string'; }; -/** - * Creates an async string schema. - * - * @param pipe A validation and transformation pipe. - * - * @returns An async string schema. - */ export function stringAsync(pipe?: PipeAsync): StringSchemaAsync; -/** - * Creates an async string schema. - * - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async string schema. - */ export function stringAsync( error?: ErrorMessage, pipe?: PipeAsync ): StringSchemaAsync; /** + * Creates an async string schema. + * * @param arg1 A validation and transformation pipe, or an error message. * @param arg2 A validation and transformation pipe. * diff --git a/library/src/schemas/tuple/tuple.ts b/library/src/schemas/tuple/tuple.ts index 36a7a9e59..979ae5652 100644 --- a/library/src/schemas/tuple/tuple.ts +++ b/library/src/schemas/tuple/tuple.ts @@ -20,43 +20,17 @@ export type TupleSchema< tuple: { items: TTupleItems; rest: TTupleRest }; }; -/** - * Creates a tuple schema. - * - * @param items The items schema. - * @param pipe A validation and transformation pipe. - * - * @returns A tuple schema. - */ export function tuple( items: TTupleItems, pipe?: Pipe> ): TupleSchema; -/** - * Creates a tuple schema. - * - * @param items The items schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A tuple schema. - */ export function tuple( items: TTupleItems, error?: ErrorMessage, pipe?: Pipe> ): TupleSchema; -/** - * Creates a tuple schema. - * - * @param items The items schema. - * @param rest The rest schema. - * @param pipe A validation and transformation pipe. - * - * @returns A tuple schema. - */ export function tuple< TTupleItems extends TupleShape, TTupleRest extends BaseSchema @@ -66,16 +40,6 @@ export function tuple< pipe?: Pipe> ): TupleSchema; -/** - * Creates a tuple schema. - * - * @param items The items schema. - * @param rest The rest schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns A tuple schema. - */ export function tuple< TTupleItems extends TupleShape, TTupleRest extends BaseSchema @@ -87,6 +51,7 @@ export function tuple< ): TupleSchema; /** + * Creates a tuple schema. * * @param items The items schema. * @param arg2 A validation and transformation pipe, or an error message, or the rest schema. diff --git a/library/src/schemas/tuple/tupleAsync.ts b/library/src/schemas/tuple/tupleAsync.ts index 4248102ad..ea3099111 100644 --- a/library/src/schemas/tuple/tupleAsync.ts +++ b/library/src/schemas/tuple/tupleAsync.ts @@ -33,43 +33,17 @@ export type TupleSchemaAsync< tuple: { items: TTupleItems; rest: TTupleRest }; }; -/** - * Creates an async tuple schema. - * - * @param items The items schema. - * @param pipe A validation and transformation pipe. - * - * @returns An async tuple schema. - */ export function tupleAsync( items: TTupleItems, pipe?: PipeAsync> ): TupleSchemaAsync; -/** - * Creates an async tuple schema. - * - * @param items The items schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async tuple schema. - */ export function tupleAsync( items: TTupleItems, error?: ErrorMessage, pipe?: PipeAsync> ): TupleSchemaAsync; -/** - * Creates an async tuple schema. - * - * @param items The items schema. - * @param rest The rest schema. - * @param pipe A validation and transformation pipe. - * - * @returns An async tuple schema. - */ export function tupleAsync< TTupleItems extends TupleShapeAsync, TTupleRest extends BaseSchema | BaseSchemaAsync | undefined @@ -79,16 +53,6 @@ export function tupleAsync< pipe?: PipeAsync> ): TupleSchemaAsync; -/** - * Creates an async tuple schema. - * - * @param items The items schema. - * @param rest The rest schema. - * @param error The error message. - * @param pipe A validation and transformation pipe. - * - * @returns An async tuple schema. - */ export function tupleAsync< TTupleItems extends TupleShapeAsync, TTupleRest extends BaseSchema | BaseSchemaAsync | undefined @@ -100,6 +64,8 @@ export function tupleAsync< ): TupleSchemaAsync; /** + * Creates an async tuple schema. + * * @param items The items schema. * @param arg2 A validation and transformation pipe, or an error message, or the rest schema. * @param arg3 A validation and transformation pipe, or an error message. From 4a37c51e8234b4fffaa14c2368f6edb6cd7fa565 Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Sun, 29 Oct 2023 14:29:00 +0900 Subject: [PATCH 06/13] fix: merge conflict --- library/src/methods/merge/merge.ts | 2 +- library/src/methods/merge/mergeAsync.ts | 2 +- library/src/methods/partial/partial.ts | 11 ++++++++--- library/src/methods/required/required.ts | 6 ++++-- library/src/schemas/object/object.ts | 8 ++++---- library/src/schemas/object/objectAsync.ts | 8 ++++---- 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/library/src/methods/merge/merge.ts b/library/src/methods/merge/merge.ts index 32b52aaf4..52bf61c82 100644 --- a/library/src/methods/merge/merge.ts +++ b/library/src/methods/merge/merge.ts @@ -33,7 +33,7 @@ export function merge( export function merge( schemas: TObjectSchemas, error?: ErrorMessage, - pipe?: Pipe>> + pipe?: Pipe, undefined>> ): ObjectSchema>; /** diff --git a/library/src/methods/merge/mergeAsync.ts b/library/src/methods/merge/mergeAsync.ts index d6571a481..f6a7c4344 100644 --- a/library/src/methods/merge/mergeAsync.ts +++ b/library/src/methods/merge/mergeAsync.ts @@ -39,7 +39,7 @@ export function mergeAsync( export function mergeAsync( schemas: TObjectSchemas, error?: ErrorMessage, - pipe?: PipeAsync>> + pipe?: PipeAsync, undefined>> ): ObjectSchemaAsync>; /** diff --git a/library/src/methods/partial/partial.ts b/library/src/methods/partial/partial.ts index f70cf1686..b1177d6d7 100644 --- a/library/src/methods/partial/partial.ts +++ b/library/src/methods/partial/partial.ts @@ -35,11 +35,16 @@ export function partial>( > ): ObjectSchema>; -export function partial>( +export function partial>( schema: TObjectSchema, error?: ErrorMessage, - pipe?: Pipe>> -): ObjectSchema>; + pipe?: Pipe< + ObjectOutput< + PartialObjectEntries, + undefined + > + > +): ObjectSchema>; /** * Creates an object schema consisting of all properties of an existing object diff --git a/library/src/methods/required/required.ts b/library/src/methods/required/required.ts index 58195bf3a..76234401d 100644 --- a/library/src/methods/required/required.ts +++ b/library/src/methods/required/required.ts @@ -35,8 +35,10 @@ export function required>( export function required>( schema: TObjectSchema, error?: ErrorMessage, - pipe?: Pipe>> -): ObjectSchema>; + pipe?: Pipe< + ObjectOutput, undefined> + > +): ObjectSchema>; /** * Creates an object schema consisting of all properties of an existing object diff --git a/library/src/schemas/object/object.ts b/library/src/schemas/object/object.ts index 4fe07bc60..9c001a4c3 100644 --- a/library/src/schemas/object/object.ts +++ b/library/src/schemas/object/object.ts @@ -37,11 +37,11 @@ export function object( pipe?: Pipe> ): ObjectSchema; -export function object( - object: TObjectShape, +export function object( + object: TObjectEntries, error?: ErrorMessage, - pipe?: Pipe> -): ObjectSchema; + pipe?: Pipe> +): ObjectSchema; /** * Creates an object schema. diff --git a/library/src/schemas/object/objectAsync.ts b/library/src/schemas/object/objectAsync.ts index 6a58beeab..0e786fed4 100644 --- a/library/src/schemas/object/objectAsync.ts +++ b/library/src/schemas/object/objectAsync.ts @@ -43,11 +43,11 @@ export function objectAsync( pipe?: PipeAsync> ): ObjectSchemaAsync; -export function objectAsync( - object: TObjectShape, +export function objectAsync( + object: TObjectEntries, error?: ErrorMessage, - pipe?: PipeAsync> -): ObjectSchemaAsync; + pipe?: PipeAsync> +): ObjectSchemaAsync; /** * Creates an async object schema. From bdc020c8709381280ab502d34d75bf60a4e9d219 Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Sun, 29 Oct 2023 15:25:02 +0900 Subject: [PATCH 07/13] fix: eslint --- library/.eslintrc.cjs | 2 +- library/src/methods/fallback/fallback.ts | 6 ++++- library/src/methods/fallback/fallbackAsync.ts | 4 +++ library/src/methods/merge/merge.ts | 25 +++++++++++-------- library/src/methods/merge/mergeAsync.ts | 21 ++++++++++------ library/src/methods/omit/omit.ts | 12 +++++++++ library/src/methods/omit/omitAsync.ts | 12 +++++++++ library/src/methods/partial/partial.ts | 15 +++++++++-- library/src/methods/partial/partialAsync.ts | 3 ++- library/src/methods/pick/pick.ts | 5 ++-- library/src/methods/pick/pickAsync.ts | 5 ++-- library/src/methods/required/required.ts | 15 +++++++++-- library/src/methods/required/requiredAsync.ts | 3 ++- .../src/methods/withDefault/withDefault.ts | 4 +-- library/src/schemas/nullable/nullable.ts | 2 ++ library/src/schemas/nullable/nullableAsync.ts | 2 ++ library/src/schemas/nullish/nullish.ts | 2 ++ library/src/schemas/nullish/nullishAsync.ts | 2 ++ library/src/schemas/object/object.ts | 8 ++++++ library/src/schemas/object/objectAsync.ts | 10 ++++++++ library/src/schemas/optional/optional.ts | 2 ++ library/src/schemas/optional/optionalAsync.ts | 2 ++ library/src/validations/equal/equal.ts | 4 +-- 23 files changed, 132 insertions(+), 34 deletions(-) diff --git a/library/.eslintrc.cjs b/library/.eslintrc.cjs index 3345e0953..798f676cb 100644 --- a/library/.eslintrc.cjs +++ b/library/.eslintrc.cjs @@ -46,7 +46,7 @@ module.exports = { 'jsdoc/tag-lines': ['error', 'any', { 'startLines': 1, }], - 'jsdoc/sort-tags': ['error', { 'linesBetween': 1, "tagSequence": [{ "tags": ["param"] }, { "tags": ["returns"] }] }], + 'jsdoc/sort-tags': ['error', { 'linesBetween': 1, "tagSequence": [{ "tags": ["deprecated"] }, { "tags": ["param"] }, { "tags": ["returns"] }] }], // Security 'security/detect-object-injection': 'off', // Too many false positives diff --git a/library/src/methods/fallback/fallback.ts b/library/src/methods/fallback/fallback.ts index ad798f1eb..fd24d1e9f 100644 --- a/library/src/methods/fallback/fallback.ts +++ b/library/src/methods/fallback/fallback.ts @@ -29,7 +29,11 @@ export function fallback< ...schema, /** - * Returns the fallback value. + * Returns the default value. + * + * @param info The fallback info. + * + * @returns The default value. */ getFallback(info) { return typeof value === 'function' diff --git a/library/src/methods/fallback/fallbackAsync.ts b/library/src/methods/fallback/fallbackAsync.ts index 2573f1635..608808399 100644 --- a/library/src/methods/fallback/fallbackAsync.ts +++ b/library/src/methods/fallback/fallbackAsync.ts @@ -30,6 +30,10 @@ export function fallbackAsync< /** * Returns the default value. + * + * @param info The fallback info. + * + * @returns The default value. */ async getFallback(info) { return typeof value === 'function' diff --git a/library/src/methods/merge/merge.ts b/library/src/methods/merge/merge.ts index 52bf61c82..1784854b4 100644 --- a/library/src/methods/merge/merge.ts +++ b/library/src/methods/merge/merge.ts @@ -30,19 +30,13 @@ export function merge( pipe?: Pipe, undefined>> ): ObjectSchema>; -export function merge( - schemas: TObjectSchemas, - error?: ErrorMessage, - pipe?: Pipe, undefined>> -): ObjectSchema>; - /** - * Merges the entries of multiple object schemas. Subsequent object entries - * overwrite the previous ones. + * Merges the entries of multiple async object schemas. Subsequent object + * entries overwrite the previous ones. * * @param schemas The schemas to be merged. - * @param arg2 A validation and transformation pipe, or an error message. - * @param arg3 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An object schema. */ @@ -92,6 +86,17 @@ export function merge< pipe?: Pipe, TObjectRest>> ): ObjectSchema, TObjectRest>; +/** + * Merges the entries of multiple object schemas. Subsequent object entries + * overwrite the previous ones. + * + * @param schemas The schemas to be merged. + * @param arg2 A validation and transformation pipe, or the error message, or the object rest. + * @param arg3 A validation and transformation pipe, or the error message. + * @param arg4 A validation and transformation pipe. + * + * @returns An object schema. + */ export function merge< TObjectSchemas extends ObjectSchemas, TObjectRest extends BaseSchema | undefined = undefined diff --git a/library/src/methods/merge/mergeAsync.ts b/library/src/methods/merge/mergeAsync.ts index f6a7c4344..030eddbf7 100644 --- a/library/src/methods/merge/mergeAsync.ts +++ b/library/src/methods/merge/mergeAsync.ts @@ -36,19 +36,13 @@ export function mergeAsync( pipe?: PipeAsync, undefined>> ): ObjectSchemaAsync>; -export function mergeAsync( - schemas: TObjectSchemas, - error?: ErrorMessage, - pipe?: PipeAsync, undefined>> -): ObjectSchemaAsync>; - /** * Merges the entries of multiple async object schemas. Subsequent object * entries overwrite the previous ones. * * @param schemas The schemas to be merged. - * @param arg2 A validation and transformation pipe, or an error message. - * @param arg3 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An async object schema. */ @@ -102,6 +96,17 @@ export function mergeAsync< > ): ObjectSchemaAsync, TObjectRest>; +/** + * Merges the entries of multiple async object schemas. Subsequent object + * entries overwrite the previous ones. + * + * @param schemas The schemas to be merged. + * @param arg2 A validation and transformation pipe, or the error message, or the object rest. + * @param arg3 A validation and transformation pipe, or the error message. + * @param arg4 A validation and transformation pipe. + * + * @returns An async object schema. + */ export function mergeAsync< TObjectSchemas extends ObjectSchemas, TObjectRest extends BaseSchema | BaseSchemaAsync | undefined = undefined diff --git a/library/src/methods/omit/omit.ts b/library/src/methods/omit/omit.ts index bb2a43b16..1ef365aba 100644 --- a/library/src/methods/omit/omit.ts +++ b/library/src/methods/omit/omit.ts @@ -98,6 +98,18 @@ export function omit< TObjectRest >; +/** + * Creates an object schema that contains not the selected keys of an existing + * schema. + * + * @param schema The schema to omit from. + * @param keys The selected keys + * @param arg3 A validation and transformation pipe, or the error message, or the object rest. + * @param arg4 A validation and transformation pipe, or an error message. + * @param arg5 A validation and transformation pipe. + * + * @returns An object schema. + */ export function omit< TObjectSchema extends ObjectSchema, TKeys extends ObjectKeys, diff --git a/library/src/methods/omit/omitAsync.ts b/library/src/methods/omit/omitAsync.ts index 2e1bb3422..04c7195aa 100644 --- a/library/src/methods/omit/omitAsync.ts +++ b/library/src/methods/omit/omitAsync.ts @@ -104,6 +104,18 @@ export function omitAsync< TObjectRest >; +/** + * Creates an async object schema that contains only the selected keys of an + * existing schema. + * + * @param schema The schema to omit from. + * @param keys The selected keys + * @param arg3 A validation and transformation pipe, or the error message, or the object rest. + * @param arg4 A validation and transformation pipe, or an error message. + * @param arg5 A validation and transformation pipe. + * + * @returns An async object schema. + */ export function omitAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends ObjectKeys, diff --git a/library/src/methods/partial/partial.ts b/library/src/methods/partial/partial.ts index b1177d6d7..e740f9256 100644 --- a/library/src/methods/partial/partial.ts +++ b/library/src/methods/partial/partial.ts @@ -51,8 +51,8 @@ export function partial>( * schema set to optional. * * @param schema The affected schema. - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An object schema. */ @@ -123,6 +123,17 @@ export function partial< TObjectRest >; +/** + * Creates an object schema consisting of all properties of an existing object + * schema set to optional. + * + * @param schema The affected schema. + * @param arg2 A validation and transformation pipe, or the error message, or the object rest. + * @param arg3 A validation and transformation pipe, or an error message. + * @param arg4 A validation and transformation pipe. + * + * @returns An object schema. + */ export function partial< TObjectSchema extends ObjectSchema, TObjectRest extends BaseSchema | undefined = undefined diff --git a/library/src/methods/partial/partialAsync.ts b/library/src/methods/partial/partialAsync.ts index 8cae5233d..4faf7a0db 100644 --- a/library/src/methods/partial/partialAsync.ts +++ b/library/src/methods/partial/partialAsync.ts @@ -114,7 +114,8 @@ export function partialAsync< * object schema set to optional. * * @param schema The affected schema. - * @param arg3 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe, or the error message, or the object rest. + * @param arg3 A validation and transformation pipe, or the error message. * @param arg4 A validation and transformation pipe. * * @returns An async object schema. diff --git a/library/src/methods/pick/pick.ts b/library/src/methods/pick/pick.ts index 116d58789..4e58174b5 100644 --- a/library/src/methods/pick/pick.ts +++ b/library/src/methods/pick/pick.ts @@ -103,8 +103,9 @@ export function pick< * * @param schema The schema to pick from. * @param keys The selected keys - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. + * @param arg3 A validation and transformation pipe, or the error message, or the object rest. + * @param arg4 A validation and transformation pipe, or the error message. + * @param arg5 A validation and transformation pipe. * * @returns An object schema. */ diff --git a/library/src/methods/pick/pickAsync.ts b/library/src/methods/pick/pickAsync.ts index b4f36cf9a..c04f6b6fc 100644 --- a/library/src/methods/pick/pickAsync.ts +++ b/library/src/methods/pick/pickAsync.ts @@ -109,8 +109,9 @@ export function pickAsync< * * @param schema The schema to pick from. * @param keys The selected keys - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. + * @param arg3 A validation and transformation pipe, or the error message, or the object rest. + * @param arg4 A validation and transformation pipe, or the error message. + * @param arg5 A validation and transformation pipe. * * @returns An async object schema. */ diff --git a/library/src/methods/required/required.ts b/library/src/methods/required/required.ts index 76234401d..825e0c265 100644 --- a/library/src/methods/required/required.ts +++ b/library/src/methods/required/required.ts @@ -45,8 +45,8 @@ export function required>( * schema set to none optional. * * @param schema The affected schema. - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An object schema. */ @@ -102,6 +102,17 @@ export function required< > ): ObjectSchema, TObjectRest>; +/** + * Creates an object schema consisting of all properties of an existing object + * schema set to none optional. + * + * @param schema The affected schema. + * @param arg2 A validation and transformation pipe, or the error message, or the object rest. + * @param arg3 A validation and transformation pipe, or the error message. + * @param arg4 A validation and transformation pipe. + * + * @returns An object schema. + */ export function required< TObjectSchema extends ObjectSchema, TObjectRest extends BaseSchema | undefined = undefined diff --git a/library/src/methods/required/requiredAsync.ts b/library/src/methods/required/requiredAsync.ts index 686cd0772..54700857a 100644 --- a/library/src/methods/required/requiredAsync.ts +++ b/library/src/methods/required/requiredAsync.ts @@ -90,7 +90,8 @@ export function requiredAsync< * object schema set to none optional. * * @param schema The affected schema. - * @param arg3 A validation and transformation pipe, or an error message. + * @param arg2 A validation and transformation pipe, or the error message, or the object rest. + * @param arg3 A validation and transformation pipe, or the error message. * @param arg4 A validation and transformation pipe. * * @returns An async object schema. diff --git a/library/src/methods/withDefault/withDefault.ts b/library/src/methods/withDefault/withDefault.ts index 3912be290..477f908cd 100644 --- a/library/src/methods/withDefault/withDefault.ts +++ b/library/src/methods/withDefault/withDefault.ts @@ -3,12 +3,12 @@ import type { BaseSchema, BaseSchemaAsync, Input } from '../../types.ts'; /** * Passes a default value to a schema in case of an undefined input. * + * @deprecated Use `optional` instead. + * * @param schema The affected schema. * @param value The default value. * * @returns The passed schema. - * - * @deprecated Use `optional` instead. */ export function withDefault( schema: TSchema, diff --git a/library/src/schemas/nullable/nullable.ts b/library/src/schemas/nullable/nullable.ts index 04ec74906..4619ba6a9 100644 --- a/library/src/schemas/nullable/nullable.ts +++ b/library/src/schemas/nullable/nullable.ts @@ -44,6 +44,8 @@ export function nullable< /** * Returns the default value. + * + * @returns The default value. */ getDefault() { return typeof value === 'function' diff --git a/library/src/schemas/nullable/nullableAsync.ts b/library/src/schemas/nullable/nullableAsync.ts index 2b3118717..971518bba 100644 --- a/library/src/schemas/nullable/nullableAsync.ts +++ b/library/src/schemas/nullable/nullableAsync.ts @@ -57,6 +57,8 @@ export function nullableAsync< /** * Returns the default value. + * + * @returns The default value. */ async getDefault() { return typeof value === 'function' diff --git a/library/src/schemas/nullish/nullish.ts b/library/src/schemas/nullish/nullish.ts index bbc19dc94..4b41471c5 100644 --- a/library/src/schemas/nullish/nullish.ts +++ b/library/src/schemas/nullish/nullish.ts @@ -44,6 +44,8 @@ export function nullish< /** * Returns the default value. + * + * @returns The default value. */ getDefault() { return typeof value === 'function' diff --git a/library/src/schemas/nullish/nullishAsync.ts b/library/src/schemas/nullish/nullishAsync.ts index 9f1b0513d..4f151ae68 100644 --- a/library/src/schemas/nullish/nullishAsync.ts +++ b/library/src/schemas/nullish/nullishAsync.ts @@ -56,6 +56,8 @@ export function nullishAsync< /** * Retutns the default value. + * + * @returns The default value. */ async getDefault() { return typeof value === 'function' diff --git a/library/src/schemas/object/object.ts b/library/src/schemas/object/object.ts index 9c001a4c3..a28fadd16 100644 --- a/library/src/schemas/object/object.ts +++ b/library/src/schemas/object/object.ts @@ -96,6 +96,14 @@ export function object< pipe?: Pipe> ): ObjectSchema; +/** + * @param entries The object entries. + * @param arg2 A validation and transformation pipe, or the error message, or the object rest. + * @param arg3 A validation and transformation pipe, or the error message. + * @param arg4 A validation and transformation pipe. + * + * @returns An object schema. + */ export function object< TObjectEntries extends ObjectEntries, TObjectRest extends BaseSchema | undefined = undefined diff --git a/library/src/schemas/object/objectAsync.ts b/library/src/schemas/object/objectAsync.ts index 0e786fed4..a5d88a9ad 100644 --- a/library/src/schemas/object/objectAsync.ts +++ b/library/src/schemas/object/objectAsync.ts @@ -102,6 +102,16 @@ export function objectAsync< pipe?: PipeAsync> ): ObjectSchemaAsync; +/** + * Creates an async object schema. + * + * @param entries The object entries. + * @param arg2 A validation and transformation pipe, or the error message, or the object rest. + * @param arg3 A validation and transformation pipe, or the error message. + * @param arg4 A validation and transformation pipe. + * + * @returns An async object schema. + */ export function objectAsync< TObjectEntries extends ObjectEntriesAsync, TObjectRest extends BaseSchema | BaseSchemaAsync | undefined = undefined diff --git a/library/src/schemas/optional/optional.ts b/library/src/schemas/optional/optional.ts index ca3497064..fa9c58a68 100644 --- a/library/src/schemas/optional/optional.ts +++ b/library/src/schemas/optional/optional.ts @@ -44,6 +44,8 @@ export function optional< /** * Returns the default value. + * + * @returns The default value. */ getDefault() { return typeof value === 'function' diff --git a/library/src/schemas/optional/optionalAsync.ts b/library/src/schemas/optional/optionalAsync.ts index 69947662b..625b7199f 100644 --- a/library/src/schemas/optional/optionalAsync.ts +++ b/library/src/schemas/optional/optionalAsync.ts @@ -55,6 +55,8 @@ export function optionalAsync< /** * Returns the default value. + * + * @returns The default value. */ async getDefault() { return typeof default_ === 'function' diff --git a/library/src/validations/equal/equal.ts b/library/src/validations/equal/equal.ts index 710f1a456..80c140c06 100644 --- a/library/src/validations/equal/equal.ts +++ b/library/src/validations/equal/equal.ts @@ -4,12 +4,12 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts'; /** * Creates a validation function that checks the value for equality. * + * @deprecated Function has been renamed to `value`. + * * @param requirement The required value. * @param error The error message. * * @returns A validation function. - * - * @deprecated Function has been renamed to `value`. */ export function equal< TInput extends string | number | bigint | boolean, From d29c7008b02e3b63782f56613bfd9e1429717fba Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Sun, 29 Oct 2023 16:38:35 +0900 Subject: [PATCH 08/13] fix: change jsdoc eslint rule for overload functions --- library/.eslintrc.cjs | 11 +++++ library/src/methods/merge/merge.ts | 11 ----- library/src/methods/merge/mergeAsync.ts | 11 ----- library/src/methods/omit/omit.ts | 33 ++++++++----- library/src/methods/omit/omitAsync.ts | 33 ++++++++----- library/src/methods/partial/partial.ts | 22 --------- library/src/methods/partial/partialAsync.ts | 30 +++++++----- library/src/methods/pick/pick.ts | 33 ++++++++----- library/src/methods/pick/pickAsync.ts | 33 ++++++++----- library/src/methods/required/required.ts | 19 -------- library/src/methods/required/requiredAsync.ts | 30 +++++++----- library/src/schemas/array/array.ts | 24 ++++++---- library/src/schemas/array/arrayAsync.ts | 24 ++++++---- library/src/schemas/bigint/bigint.ts | 15 ++++-- library/src/schemas/bigint/bigintAsync.ts | 21 ++++++--- library/src/schemas/blob/blob.ts | 15 ++++-- library/src/schemas/blob/blobAsync.ts | 21 ++++++--- library/src/schemas/boolean/boolean.ts | 21 ++++++--- library/src/schemas/boolean/booleanAsync.ts | 21 ++++++--- library/src/schemas/date/date.ts | 15 ++++-- library/src/schemas/date/dateAsync.ts | 21 ++++++--- library/src/schemas/instance/instance.ts | 24 ++++++---- library/src/schemas/instance/instanceAsync.ts | 24 ++++++---- library/src/schemas/map/map.ts | 27 +++++++---- library/src/schemas/map/mapAsync.ts | 29 ++++++++---- library/src/schemas/number/number.ts | 15 ++++-- library/src/schemas/number/numberAsync.ts | 21 ++++++--- library/src/schemas/object/object.ts | 14 ------ library/src/schemas/object/objectAsync.ts | 6 --- library/src/schemas/record/record.ts | 46 +++++++++++++++---- library/src/schemas/record/recordAsync.ts | 46 +++++++++++++++---- library/src/schemas/set/set.ts | 24 ++++++---- library/src/schemas/set/setAsync.ts | 24 ++++++---- library/src/schemas/special/special.ts | 24 ++++++---- library/src/schemas/special/specialAsync.ts | 26 +++++++---- library/src/schemas/string/string.ts | 15 ++++-- library/src/schemas/string/stringAsync.ts | 21 ++++++--- library/src/schemas/tuple/tuple.ts | 29 ++++++++---- library/src/schemas/tuple/tupleAsync.ts | 29 ++++++++---- 39 files changed, 562 insertions(+), 346 deletions(-) diff --git a/library/.eslintrc.cjs b/library/.eslintrc.cjs index 798f676cb..edbb8798c 100644 --- a/library/.eslintrc.cjs +++ b/library/.eslintrc.cjs @@ -47,6 +47,17 @@ module.exports = { 'startLines': 1, }], 'jsdoc/sort-tags': ['error', { 'linesBetween': 1, "tagSequence": [{ "tags": ["deprecated"] }, { "tags": ["param"] }, { "tags": ["returns"] }] }], + // NOTE: For overloads functions, we only require a JSDoc at the top + // SEE: https://github.com/gajus/eslint-plugin-jsdoc/issues/666 + "jsdoc/require-jsdoc": ["error", { + "contexts": [ + 'ExportNamedDeclaration[declaration.type="TSDeclareFunction"]:not(ExportNamedDeclaration[declaration.type="TSDeclareFunction"] + ExportNamedDeclaration[declaration.type="TSDeclareFunction"])', + 'ExportNamedDeclaration[declaration.type="FunctionDeclaration"]:not(ExportNamedDeclaration[declaration.type="TSDeclareFunction"] + ExportNamedDeclaration[declaration.type="FunctionDeclaration"])', + ], + "require": { + "FunctionDeclaration": false + } + }], // Security 'security/detect-object-injection': 'off', // Too many false positives diff --git a/library/src/methods/merge/merge.ts b/library/src/methods/merge/merge.ts index 1784854b4..1e2c0cdff 100644 --- a/library/src/methods/merge/merge.ts +++ b/library/src/methods/merge/merge.ts @@ -86,17 +86,6 @@ export function merge< pipe?: Pipe, TObjectRest>> ): ObjectSchema, TObjectRest>; -/** - * Merges the entries of multiple object schemas. Subsequent object entries - * overwrite the previous ones. - * - * @param schemas The schemas to be merged. - * @param arg2 A validation and transformation pipe, or the error message, or the object rest. - * @param arg3 A validation and transformation pipe, or the error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An object schema. - */ export function merge< TObjectSchemas extends ObjectSchemas, TObjectRest extends BaseSchema | undefined = undefined diff --git a/library/src/methods/merge/mergeAsync.ts b/library/src/methods/merge/mergeAsync.ts index 030eddbf7..30905d6cb 100644 --- a/library/src/methods/merge/mergeAsync.ts +++ b/library/src/methods/merge/mergeAsync.ts @@ -96,17 +96,6 @@ export function mergeAsync< > ): ObjectSchemaAsync, TObjectRest>; -/** - * Merges the entries of multiple async object schemas. Subsequent object - * entries overwrite the previous ones. - * - * @param schemas The schemas to be merged. - * @param arg2 A validation and transformation pipe, or the error message, or the object rest. - * @param arg3 A validation and transformation pipe, or the error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An async object schema. - */ export function mergeAsync< TObjectSchemas extends ObjectSchemas, TObjectRest extends BaseSchema | BaseSchemaAsync | undefined = undefined diff --git a/library/src/methods/omit/omit.ts b/library/src/methods/omit/omit.ts index 1ef365aba..44f5ccc79 100644 --- a/library/src/methods/omit/omit.ts +++ b/library/src/methods/omit/omit.ts @@ -7,6 +7,16 @@ import type { BaseSchema, ErrorMessage, Pipe } from '../../types.ts'; import { getRestAndDefaultArgs } from '../../utils/index.ts'; import type { ObjectKeys } from './types.ts'; +/** + * Creates an object schema that contains not the selected keys of an existing + * schema. + * + * @param schema The schema to omit from. + * @param keys The selected keys + * @param pipe A validation and transformation pipe. + * + * @returns An object schema. + */ export function omit< TObjectSchema extends ObjectSchema, TKeys extends ObjectKeys @@ -21,6 +31,17 @@ export function omit< > ): ObjectSchema>; +/** + * Creates an object schema that contains not the selected keys of an existing + * schema. + * + * @param schema The schema to omit from. + * @param keys The selected keys + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns An object schema. + */ export function omit< TObjectSchema extends ObjectSchema, TKeys extends ObjectKeys @@ -98,18 +119,6 @@ export function omit< TObjectRest >; -/** - * Creates an object schema that contains not the selected keys of an existing - * schema. - * - * @param schema The schema to omit from. - * @param keys The selected keys - * @param arg3 A validation and transformation pipe, or the error message, or the object rest. - * @param arg4 A validation and transformation pipe, or an error message. - * @param arg5 A validation and transformation pipe. - * - * @returns An object schema. - */ export function omit< TObjectSchema extends ObjectSchema, TKeys extends ObjectKeys, diff --git a/library/src/methods/omit/omitAsync.ts b/library/src/methods/omit/omitAsync.ts index 04c7195aa..c7ee26795 100644 --- a/library/src/methods/omit/omitAsync.ts +++ b/library/src/methods/omit/omitAsync.ts @@ -13,6 +13,16 @@ import type { import { getRestAndDefaultArgs } from '../../utils/index.ts'; import type { ObjectKeys } from './types.ts'; +/** + * Creates an async object schema that contains only the selected keys of an + * existing schema. + * + * @param schema The schema to omit from. + * @param keys The selected keys + * @param pipe A validation and transformation pipe. + * + * @returns An async object schema. + */ export function omitAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends ObjectKeys @@ -27,6 +37,17 @@ export function omitAsync< > ): ObjectSchemaAsync>; +/** + * Creates an async object schema that contains only the selected keys of an + * existing schema. + * + * @param schema The schema to omit from. + * @param keys The selected keys + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns An async object schema. + */ export function omitAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends ObjectKeys @@ -104,18 +125,6 @@ export function omitAsync< TObjectRest >; -/** - * Creates an async object schema that contains only the selected keys of an - * existing schema. - * - * @param schema The schema to omit from. - * @param keys The selected keys - * @param arg3 A validation and transformation pipe, or the error message, or the object rest. - * @param arg4 A validation and transformation pipe, or an error message. - * @param arg5 A validation and transformation pipe. - * - * @returns An async object schema. - */ export function omitAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends ObjectKeys, diff --git a/library/src/methods/partial/partial.ts b/library/src/methods/partial/partial.ts index e740f9256..b1a860ce8 100644 --- a/library/src/methods/partial/partial.ts +++ b/library/src/methods/partial/partial.ts @@ -35,17 +35,6 @@ export function partial>( > ): ObjectSchema>; -export function partial>( - schema: TObjectSchema, - error?: ErrorMessage, - pipe?: Pipe< - ObjectOutput< - PartialObjectEntries, - undefined - > - > -): ObjectSchema>; - /** * Creates an object schema consisting of all properties of an existing object * schema set to optional. @@ -123,17 +112,6 @@ export function partial< TObjectRest >; -/** - * Creates an object schema consisting of all properties of an existing object - * schema set to optional. - * - * @param schema The affected schema. - * @param arg2 A validation and transformation pipe, or the error message, or the object rest. - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An object schema. - */ export function partial< TObjectSchema extends ObjectSchema, TObjectRest extends BaseSchema | undefined = undefined diff --git a/library/src/methods/partial/partialAsync.ts b/library/src/methods/partial/partialAsync.ts index 4faf7a0db..38bad7f79 100644 --- a/library/src/methods/partial/partialAsync.ts +++ b/library/src/methods/partial/partialAsync.ts @@ -24,6 +24,15 @@ export type PartialObjectEntriesAsync< [TKey in keyof TObjectEntries]: OptionalSchemaAsync; }; +/** + * Creates an async object schema consisting of all properties of an existing + * object schema set to optional. + * + * @param schema The affected schema. + * @param pipe A validation and transformation pipe. + * + * @returns An async object schema. + */ export function partialAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync >( @@ -38,6 +47,16 @@ export function partialAsync< PartialObjectEntriesAsync >; +/** + * Creates an async object schema consisting of all properties of an existing + * object schema set to optional. + * + * @param schema The affected schema. + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns An async object schema. + */ export function partialAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync >( @@ -109,17 +128,6 @@ export function partialAsync< TObjectRest >; -/** - * Creates an async object schema consisting of all properties of an existing - * object schema set to optional. - * - * @param schema The affected schema. - * @param arg2 A validation and transformation pipe, or the error message, or the object rest. - * @param arg3 A validation and transformation pipe, or the error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An async object schema. - */ export function partialAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TObjectRest extends BaseSchema | undefined = undefined diff --git a/library/src/methods/pick/pick.ts b/library/src/methods/pick/pick.ts index 4e58174b5..058e28026 100644 --- a/library/src/methods/pick/pick.ts +++ b/library/src/methods/pick/pick.ts @@ -6,6 +6,16 @@ import { import type { BaseSchema, ErrorMessage, Pipe } from '../../types.ts'; import { getRestAndDefaultArgs } from '../../utils/index.ts'; +/** + * Creates an object schema that contains only the selected keys of an existing + * schema. + * + * @param schema The schema to pick from. + * @param keys The selected keys + * @param pipe A validation and transformation pipe. + * + * @returns An object schema. + */ export function pick< TObjectSchema extends ObjectSchema, TKeys extends (keyof TObjectSchema['object']['entries'])[] @@ -20,6 +30,17 @@ export function pick< > ): ObjectSchema>; +/** + * Creates an object schema that contains only the selected keys of an existing + * schema. + * + * @param schema The schema to pick from. + * @param keys The selected keys + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns An object schema. + */ export function pick< TObjectSchema extends ObjectSchema, TKeys extends (keyof TObjectSchema['object']['entries'])[] @@ -97,18 +118,6 @@ export function pick< TObjectRest >; -/** - * Creates an object schema that contains only the selected keys of an existing - * schema. - * - * @param schema The schema to pick from. - * @param keys The selected keys - * @param arg3 A validation and transformation pipe, or the error message, or the object rest. - * @param arg4 A validation and transformation pipe, or the error message. - * @param arg5 A validation and transformation pipe. - * - * @returns An object schema. - */ export function pick< TObjectSchema extends ObjectSchema, TKeys extends (keyof TObjectSchema['object']['entries'])[], diff --git a/library/src/methods/pick/pickAsync.ts b/library/src/methods/pick/pickAsync.ts index c04f6b6fc..43caff114 100644 --- a/library/src/methods/pick/pickAsync.ts +++ b/library/src/methods/pick/pickAsync.ts @@ -12,6 +12,16 @@ import type { } from '../../types.ts'; import { getRestAndDefaultArgs } from '../../utils/index.ts'; +/** + * Creates an async object schema that contains only the selected keys of an + * existing schema. + * + * @param schema The schema to pick from. + * @param keys The selected keys + * @param pipe A validation and transformation pipe. + * + * @returns An async object schema. + */ export function pickAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends (keyof TObjectSchema['object']['entries'])[] @@ -26,6 +36,17 @@ export function pickAsync< > ): ObjectSchemaAsync>; +/** + * Creates an async object schema that contains only the selected keys of an + * existing schema. + * + * @param schema The schema to pick from. + * @param keys The selected keys + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns An async object schema. + */ export function pickAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends (keyof TObjectSchema['object']['entries'])[] @@ -103,18 +124,6 @@ export function pickAsync< TObjectRest >; -/** - * Creates an async object schema that contains only the selected keys of an - * existing schema. - * - * @param schema The schema to pick from. - * @param keys The selected keys - * @param arg3 A validation and transformation pipe, or the error message, or the object rest. - * @param arg4 A validation and transformation pipe, or the error message. - * @param arg5 A validation and transformation pipe. - * - * @returns An async object schema. - */ export function pickAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TKeys extends (keyof TObjectSchema['object']['entries'])[], diff --git a/library/src/methods/required/required.ts b/library/src/methods/required/required.ts index 825e0c265..77b27b68f 100644 --- a/library/src/methods/required/required.ts +++ b/library/src/methods/required/required.ts @@ -32,14 +32,6 @@ export function required>( > ): ObjectSchema>; -export function required>( - schema: TObjectSchema, - error?: ErrorMessage, - pipe?: Pipe< - ObjectOutput, undefined> - > -): ObjectSchema>; - /** * Creates an object schema consisting of all properties of an existing object * schema set to none optional. @@ -102,17 +94,6 @@ export function required< > ): ObjectSchema, TObjectRest>; -/** - * Creates an object schema consisting of all properties of an existing object - * schema set to none optional. - * - * @param schema The affected schema. - * @param arg2 A validation and transformation pipe, or the error message, or the object rest. - * @param arg3 A validation and transformation pipe, or the error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An object schema. - */ export function required< TObjectSchema extends ObjectSchema, TObjectRest extends BaseSchema | undefined = undefined diff --git a/library/src/methods/required/requiredAsync.ts b/library/src/methods/required/requiredAsync.ts index 54700857a..ef33c7290 100644 --- a/library/src/methods/required/requiredAsync.ts +++ b/library/src/methods/required/requiredAsync.ts @@ -22,6 +22,15 @@ type Required = { [TKey in keyof TObjectEntries]: NonOptionalSchemaAsync; }; +/** + * Creates an async object schema consisting of all properties of an existing + * object schema set to none optional. + * + * @param schema The affected schema. + * @param pipe A validation and transformation pipe. + * + * @returns An async object schema. + */ export function requiredAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync >( @@ -31,6 +40,16 @@ export function requiredAsync< > ): ObjectSchemaAsync>; +/** + * Creates an async object schema consisting of all properties of an existing + * object schema set to none optional. + * + * @param schema The affected schema. + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns An async object schema. + */ export function requiredAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync >( @@ -85,17 +104,6 @@ export function requiredAsync< > ): ObjectSchemaAsync, TObjectRest>; -/** - * Creates an async object schema consisting of all properties of an existing - * object schema set to none optional. - * - * @param schema The affected schema. - * @param arg2 A validation and transformation pipe, or the error message, or the object rest. - * @param arg3 A validation and transformation pipe, or the error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An async object schema. - */ export function requiredAsync< TObjectSchema extends ObjectSchema | ObjectSchemaAsync, TObjectRest extends BaseSchema | BaseSchemaAsync | undefined = undefined diff --git a/library/src/schemas/array/array.ts b/library/src/schemas/array/array.ts index 567dde619..fc09a7469 100644 --- a/library/src/schemas/array/array.ts +++ b/library/src/schemas/array/array.ts @@ -25,26 +25,34 @@ export type ArraySchema< array: { item: TArrayItem }; }; +/** + * Creates a array schema. + * + * @param item The item schema. + * @param pipe A validation and transformation pipe. + * + * @returns A array schema. + */ export function array( item: TArrayItem, pipe?: Pipe[]> ): ArraySchema; -export function array( - item: TArrayItem, - error?: ErrorMessage, - pipe?: Pipe[]> -): ArraySchema; - /** * Creates a array schema. * * @param item The item schema. - * @param arg2 A validation and transformation pipe, or an error message. - * @param arg3 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns A array schema. */ +export function array( + item: TArrayItem, + error?: ErrorMessage, + pipe?: Pipe[]> +): ArraySchema; + export function array( item: TArrayItem, arg2?: ErrorMessage | Pipe[]>, diff --git a/library/src/schemas/array/arrayAsync.ts b/library/src/schemas/array/arrayAsync.ts index 746f60b30..496be7f90 100644 --- a/library/src/schemas/array/arrayAsync.ts +++ b/library/src/schemas/array/arrayAsync.ts @@ -26,26 +26,34 @@ export type ArraySchemaAsync< array: { item: TArrayItem }; }; +/** + * Creates an async array schema. + * + * @param item The item schema. + * @param pipe A validation and transformation pipe. + * + * @returns An async array schema. + */ export function arrayAsync( item: TArrayItem, pipe?: PipeAsync[]> ): ArraySchemaAsync; -export function arrayAsync( - item: TArrayItem, - error?: ErrorMessage, - pipe?: PipeAsync[]> -): ArraySchemaAsync; - /** * Creates an async array schema. * * @param item The item schema. - * @param arg2 A validation and transformation pipe, or an error message. - * @param arg3 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An async array schema. */ +export function arrayAsync( + item: TArrayItem, + error?: ErrorMessage, + pipe?: PipeAsync[]> +): ArraySchemaAsync; + export function arrayAsync( item: TArrayItem, arg2?: ErrorMessage | PipeAsync[]>, diff --git a/library/src/schemas/bigint/bigint.ts b/library/src/schemas/bigint/bigint.ts index fb5e67364..422a8b087 100644 --- a/library/src/schemas/bigint/bigint.ts +++ b/library/src/schemas/bigint/bigint.ts @@ -12,18 +12,25 @@ export type BigintSchema = BaseSchema & { schema: 'bigint'; }; +/** + * Creates a bigint schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns A bigint schema. + */ export function bigint(pipe?: Pipe): BigintSchema; -export function bigint(error?: ErrorMessage, pipe?: Pipe): BigintSchema; - /** * Creates a bigint schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns A bigint schema. */ +export function bigint(error?: ErrorMessage, pipe?: Pipe): BigintSchema; + export function bigint( arg1?: ErrorMessage | Pipe, arg2?: Pipe diff --git a/library/src/schemas/bigint/bigintAsync.ts b/library/src/schemas/bigint/bigintAsync.ts index 8ea79dd4b..a1bbb1d44 100644 --- a/library/src/schemas/bigint/bigintAsync.ts +++ b/library/src/schemas/bigint/bigintAsync.ts @@ -15,21 +15,28 @@ export type BigintSchemaAsync = BaseSchemaAsync< schema: 'bigint'; }; +/** + * Creates an async bigint schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns An async bigint schema. + */ export function bigintAsync(pipe?: PipeAsync): BigintSchemaAsync; -export function bigintAsync( - error?: ErrorMessage, - pipe?: PipeAsync -): BigintSchemaAsync; - /** * Creates an async bigint schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An async bigint schema. */ +export function bigintAsync( + error?: ErrorMessage, + pipe?: PipeAsync +): BigintSchemaAsync; + export function bigintAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync diff --git a/library/src/schemas/blob/blob.ts b/library/src/schemas/blob/blob.ts index ca84b4ab8..605e1b2ad 100644 --- a/library/src/schemas/blob/blob.ts +++ b/library/src/schemas/blob/blob.ts @@ -12,18 +12,25 @@ export type BlobSchema = BaseSchema & { schema: 'blob'; }; +/** + * Creates a blob schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns A blob schema. + */ export function blob(pipe?: Pipe): BlobSchema; -export function blob(error?: ErrorMessage, pipe?: Pipe): BlobSchema; - /** * Creates a blob schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns A blob schema. */ +export function blob(error?: ErrorMessage, pipe?: Pipe): BlobSchema; + export function blob( arg1?: ErrorMessage | Pipe, arg2?: Pipe diff --git a/library/src/schemas/blob/blobAsync.ts b/library/src/schemas/blob/blobAsync.ts index e54d4c221..4a92a3c28 100644 --- a/library/src/schemas/blob/blobAsync.ts +++ b/library/src/schemas/blob/blobAsync.ts @@ -12,21 +12,28 @@ export type BlobSchemaAsync = BaseSchemaAsync & { schema: 'blob'; }; +/** + * Creates an async blob schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns An async blob schema. + */ export function blobAsync(pipe?: PipeAsync): BlobSchemaAsync; -export function blobAsync( - error?: ErrorMessage, - pipe?: PipeAsync -): BlobSchemaAsync; - /** * Creates an async blob schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An async blob schema. */ +export function blobAsync( + error?: ErrorMessage, + pipe?: PipeAsync +): BlobSchemaAsync; + export function blobAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync diff --git a/library/src/schemas/boolean/boolean.ts b/library/src/schemas/boolean/boolean.ts index 81757c70a..bc39675f3 100644 --- a/library/src/schemas/boolean/boolean.ts +++ b/library/src/schemas/boolean/boolean.ts @@ -12,21 +12,28 @@ export type BooleanSchema = BaseSchema & { schema: 'boolean'; }; +/** + * Creates a boolean schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns A boolean schema. + */ export function boolean(pipe?: Pipe): BooleanSchema; -export function boolean( - error?: ErrorMessage, - pipe?: Pipe -): BooleanSchema; - /** * Creates a boolean schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns A boolean schema. */ +export function boolean( + error?: ErrorMessage, + pipe?: Pipe +): BooleanSchema; + export function boolean( arg1?: ErrorMessage | Pipe, arg2?: Pipe diff --git a/library/src/schemas/boolean/booleanAsync.ts b/library/src/schemas/boolean/booleanAsync.ts index 7541b72fc..5001eadac 100644 --- a/library/src/schemas/boolean/booleanAsync.ts +++ b/library/src/schemas/boolean/booleanAsync.ts @@ -15,21 +15,28 @@ export type BooleanSchemaAsync = BaseSchemaAsync< schema: 'boolean'; }; +/** + * Creates an async boolean schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns An async boolean schema. + */ export function booleanAsync(pipe?: PipeAsync): BooleanSchemaAsync; -export function booleanAsync( - error?: ErrorMessage, - pipe?: PipeAsync -): BooleanSchemaAsync; - /** * Creates an async boolean schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An async boolean schema. */ +export function booleanAsync( + error?: ErrorMessage, + pipe?: PipeAsync +): BooleanSchemaAsync; + export function booleanAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync diff --git a/library/src/schemas/date/date.ts b/library/src/schemas/date/date.ts index 2907e8a79..e775076a3 100644 --- a/library/src/schemas/date/date.ts +++ b/library/src/schemas/date/date.ts @@ -12,18 +12,25 @@ export type DateSchema = BaseSchema & { schema: 'date'; }; +/** + * Creates a date schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns A date schema. + */ export function date(pipe?: Pipe): DateSchema; -export function date(error?: ErrorMessage, pipe?: Pipe): DateSchema; - /** * Creates a date schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns A date schema. */ +export function date(error?: ErrorMessage, pipe?: Pipe): DateSchema; + export function date( arg1?: ErrorMessage | Pipe, arg2?: Pipe diff --git a/library/src/schemas/date/dateAsync.ts b/library/src/schemas/date/dateAsync.ts index 0f79d030f..aa000d482 100644 --- a/library/src/schemas/date/dateAsync.ts +++ b/library/src/schemas/date/dateAsync.ts @@ -12,21 +12,28 @@ export type DateSchemaAsync = BaseSchemaAsync & { schema: 'date'; }; +/** + * Creates an async date schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns An async date schema. + */ export function dateAsync(pipe?: PipeAsync): DateSchemaAsync; -export function dateAsync( - error?: ErrorMessage, - pipe?: PipeAsync -): DateSchemaAsync; - /** * Creates an async date schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An async date schema. */ +export function dateAsync( + error?: ErrorMessage, + pipe?: PipeAsync +): DateSchemaAsync; + export function dateAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync diff --git a/library/src/schemas/instance/instance.ts b/library/src/schemas/instance/instance.ts index 22c432197..bb72ac43c 100644 --- a/library/src/schemas/instance/instance.ts +++ b/library/src/schemas/instance/instance.ts @@ -21,26 +21,34 @@ export type InstanceSchema< class: TClass; }; +/** + * Creates an instance schema. + * + * @param of The class of the instance. + * @param pipe A validation and transformation pipe. + * + * @returns An instance schema. + */ export function instance( of: TClass, pipe?: Pipe> ): InstanceSchema; -export function instance( - of: TClass, - error?: ErrorMessage, - pipe?: Pipe> -): InstanceSchema; - /** * Creates an instance schema. * * @param of The class of the instance. - * @param arg2 A validation and transformation pipe, or an error message. - * @param arg3 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An instance schema. */ +export function instance( + of: TClass, + error?: ErrorMessage, + pipe?: Pipe> +): InstanceSchema; + export function instance( of: TClass, arg2?: Pipe> | ErrorMessage, diff --git a/library/src/schemas/instance/instanceAsync.ts b/library/src/schemas/instance/instanceAsync.ts index 3f38fa0b7..a2a029de8 100644 --- a/library/src/schemas/instance/instanceAsync.ts +++ b/library/src/schemas/instance/instanceAsync.ts @@ -17,26 +17,34 @@ export type InstanceSchemaAsync< class: TClass; }; +/** + * Creates an async instance schema. + * + * @param of The class of the instance. + * @param pipe A validation and transformation pipe. + * + * @returns An async instance schema. + */ export function instanceAsync( of: TClass, pipe?: PipeAsync> ): InstanceSchemaAsync; -export function instanceAsync( - of: TClass, - error?: ErrorMessage, - pipe?: PipeAsync> -): InstanceSchemaAsync; - /** * Creates an async instance schema. * * @param of The class of the instance. - * @param arg2 A validation and transformation pipe, or an error message. - * @param arg3 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An async instance schema. */ +export function instanceAsync( + of: TClass, + error?: ErrorMessage, + pipe?: PipeAsync> +): InstanceSchemaAsync; + export function instanceAsync( of: TClass, arg2?: PipeAsync> | ErrorMessage, diff --git a/library/src/schemas/map/map.ts b/library/src/schemas/map/map.ts index 146a457e1..33c371ddd 100644 --- a/library/src/schemas/map/map.ts +++ b/library/src/schemas/map/map.ts @@ -25,29 +25,38 @@ export type MapSchema< map: { key: TMapKey; value: TMapValue }; }; +/** + * Creates a map schema. + * + * @param key The key schema. + * @param value The value schema. + * @param pipe A validation and transformation pipe. + * + * @returns A map schema. + */ export function map( key: TMapKey, value: TMapValue, pipe?: Pipe> ): MapSchema; -export function map( - key: TMapKey, - value: TMapValue, - error?: ErrorMessage, - pipe?: Pipe> -): MapSchema; - /** * Creates a map schema. * * @param key The key schema. * @param value The value schema. - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns A map schema. */ +export function map( + key: TMapKey, + value: TMapValue, + error?: ErrorMessage, + pipe?: Pipe> +): MapSchema; + export function map( key: TMapKey, value: TMapValue, diff --git a/library/src/schemas/map/mapAsync.ts b/library/src/schemas/map/mapAsync.ts index 60b34f779..e1a7ef29b 100644 --- a/library/src/schemas/map/mapAsync.ts +++ b/library/src/schemas/map/mapAsync.ts @@ -26,6 +26,15 @@ export type MapSchemaAsync< map: { key: TMapKey; value: TMapValue }; }; +/** + * Creates an async map schema. + * + * @param key The key schema. + * @param value The value schema. + * @param pipe A validation and transformation pipe. + * + * @returns An async map schema. + */ export function mapAsync< TMapKey extends BaseSchema | BaseSchemaAsync, TMapValue extends BaseSchema | BaseSchemaAsync @@ -35,6 +44,16 @@ export function mapAsync< pipe?: PipeAsync> ): MapSchemaAsync; +/** + * Creates an async map schema. + * + * @param key The key schema. + * @param value The value schema. + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns An async map schema. + */ export function mapAsync< TMapKey extends BaseSchema | BaseSchemaAsync, TMapValue extends BaseSchema | BaseSchemaAsync @@ -45,16 +64,6 @@ export function mapAsync< pipe?: PipeAsync> ): MapSchemaAsync; -/** - * Creates an async map schema. - * - * @param key The key schema. - * @param value The value schema. - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An async map schema. - */ export function mapAsync< TMapKey extends BaseSchema | BaseSchemaAsync, TMapValue extends BaseSchema | BaseSchemaAsync diff --git a/library/src/schemas/number/number.ts b/library/src/schemas/number/number.ts index bb1667c3c..ba53ed44c 100644 --- a/library/src/schemas/number/number.ts +++ b/library/src/schemas/number/number.ts @@ -12,18 +12,25 @@ export type NumberSchema = BaseSchema & { schema: 'number'; }; +/** + * Creates a number schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns A number schema. + */ export function number(pipe?: Pipe): NumberSchema; -export function number(error?: ErrorMessage, pipe?: Pipe): NumberSchema; - /** * Creates a number schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns A number schema. */ +export function number(error?: ErrorMessage, pipe?: Pipe): NumberSchema; + export function number( arg1?: ErrorMessage | Pipe, arg2?: Pipe diff --git a/library/src/schemas/number/numberAsync.ts b/library/src/schemas/number/numberAsync.ts index b2f33553e..20d2c82e0 100644 --- a/library/src/schemas/number/numberAsync.ts +++ b/library/src/schemas/number/numberAsync.ts @@ -15,21 +15,28 @@ export type NumberSchemaAsync = BaseSchemaAsync< schema: 'number'; }; +/** + * Creates an async number schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns An async number schema. + */ export function numberAsync(pipe?: PipeAsync): NumberSchemaAsync; -export function numberAsync( - error?: ErrorMessage, - pipe?: PipeAsync -): NumberSchemaAsync; - /** * Creates an async number schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An async number schema. */ +export function numberAsync( + error?: ErrorMessage, + pipe?: PipeAsync +): NumberSchemaAsync; + export function numberAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync diff --git a/library/src/schemas/object/object.ts b/library/src/schemas/object/object.ts index a28fadd16..0750aac92 100644 --- a/library/src/schemas/object/object.ts +++ b/library/src/schemas/object/object.ts @@ -37,12 +37,6 @@ export function object( pipe?: Pipe> ): ObjectSchema; -export function object( - object: TObjectEntries, - error?: ErrorMessage, - pipe?: Pipe> -): ObjectSchema; - /** * Creates an object schema. * @@ -96,14 +90,6 @@ export function object< pipe?: Pipe> ): ObjectSchema; -/** - * @param entries The object entries. - * @param arg2 A validation and transformation pipe, or the error message, or the object rest. - * @param arg3 A validation and transformation pipe, or the error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An object schema. - */ export function object< TObjectEntries extends ObjectEntries, TObjectRest extends BaseSchema | undefined = undefined diff --git a/library/src/schemas/object/objectAsync.ts b/library/src/schemas/object/objectAsync.ts index a5d88a9ad..e3f45a270 100644 --- a/library/src/schemas/object/objectAsync.ts +++ b/library/src/schemas/object/objectAsync.ts @@ -43,12 +43,6 @@ export function objectAsync( pipe?: PipeAsync> ): ObjectSchemaAsync; -export function objectAsync( - object: TObjectEntries, - error?: ErrorMessage, - pipe?: PipeAsync> -): ObjectSchemaAsync; - /** * Creates an async object schema. * diff --git a/library/src/schemas/record/record.ts b/library/src/schemas/record/record.ts index 5966ebbe2..9c4c91257 100644 --- a/library/src/schemas/record/record.ts +++ b/library/src/schemas/record/record.ts @@ -29,17 +29,43 @@ export type RecordSchema< record: { key: TRecordKey; value: TRecordValue }; }; +/** + * Creates a record schema. + * + * @param value The value schema. + * @param pipe A validation and transformation pipe. + * + * @returns A record schema. + */ export function record( value: TRecordValue, pipe?: Pipe> ): RecordSchema; +/** + * Creates a record schema. + * + * @param value The value schema. + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns A record schema. + */ export function record( value: TRecordValue, error?: ErrorMessage, pipe?: Pipe> ): RecordSchema; +/** + * Creates a record schema. + * + * @param key The key schema. + * @param value The value schema. + * @param pipe A validation and transformation pipe. + * + * @returns A record schema. + */ export function record< TRecordKey extends RecordKey, TRecordValue extends BaseSchema @@ -49,6 +75,16 @@ export function record< pipe?: Pipe> ): RecordSchema; +/** + * Creates a record schema. + * + * @param key The key schema. + * @param value The value schema. + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns A record schema. + */ export function record< TRecordKey extends RecordKey, TRecordValue extends BaseSchema @@ -59,16 +95,6 @@ export function record< pipe?: Pipe> ): RecordSchema; -/** - * Creates a record schema. - * - * @param arg1 The value or key schema. - * @param arg2 A validation and transformation pipe, or an error message, or the value schema. - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. - * - * @returns A record schema. - */ export function record< TRecordKey extends RecordKey, TRecordValue extends BaseSchema diff --git a/library/src/schemas/record/recordAsync.ts b/library/src/schemas/record/recordAsync.ts index a7e2a1fa3..e9a835340 100644 --- a/library/src/schemas/record/recordAsync.ts +++ b/library/src/schemas/record/recordAsync.ts @@ -46,17 +46,43 @@ export type RecordSchemaAsync< record: { key: TRecordKey; value: TRecordValue }; }; +/** + * Creates an async record schema. + * + * @param value The value schema. + * @param pipe A validation and transformation pipe. + * + * @returns An async record schema. + */ export function recordAsync( value: TRecordValue, pipe?: PipeAsync> ): RecordSchemaAsync; +/** + * Creates an async record schema. + * + * @param value The value schema. + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns An async record schema. + */ export function recordAsync( value: TRecordValue, error?: ErrorMessage, pipe?: PipeAsync> ): RecordSchemaAsync; +/** + * Creates an async record schema. + * + * @param key The key schema. + * @param value The value schema. + * @param pipe A validation and transformation pipe. + * + * @returns An async record schema. + */ export function recordAsync< TRecordKey extends RecordKeyAsync, TRecordValue extends BaseSchema | BaseSchemaAsync @@ -66,6 +92,16 @@ export function recordAsync< pipe?: PipeAsync> ): RecordSchemaAsync; +/** + * Creates an async record schema. + * + * @param key The key schema. + * @param value The value schema. + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns An async record schema. + */ export function recordAsync< TRecordKey extends RecordKeyAsync, TRecordValue extends BaseSchema | BaseSchemaAsync @@ -76,16 +112,6 @@ export function recordAsync< pipe?: PipeAsync> ): RecordSchemaAsync; -/** - * Creates an async record schema. - * - * @param arg1 The value or key schema. - * @param arg2 A validation and transformation pipe, or an error message, or the value schema. - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An async record schema. - */ export function recordAsync< TRecordKey extends RecordKeyAsync, TRecordValue extends BaseSchema | BaseSchemaAsync diff --git a/library/src/schemas/set/set.ts b/library/src/schemas/set/set.ts index 281fb12a5..3e3bbae59 100644 --- a/library/src/schemas/set/set.ts +++ b/library/src/schemas/set/set.ts @@ -18,26 +18,34 @@ export type SetSchema< set: { value: TSetValue }; }; +/** + * Creates a set schema. + * + * @param value The value schema. + * @param pipe A validation and transformation pipe. + * + * @returns A set schema. + */ export function set( value: TSetValue, pipe?: Pipe> ): SetSchema; -export function set( - value: TSetValue, - error?: ErrorMessage, - pipe?: Pipe> -): SetSchema; - /** * Creates a set schema. * * @param value The value schema. - * @param arg2 A validation and transformation pipe, or an error message. - * @param arg3 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns A set schema. */ +export function set( + value: TSetValue, + error?: ErrorMessage, + pipe?: Pipe> +): SetSchema; + export function set( value: TSetValue, arg2?: Pipe> | ErrorMessage, diff --git a/library/src/schemas/set/setAsync.ts b/library/src/schemas/set/setAsync.ts index da2b76060..67fb21fa3 100644 --- a/library/src/schemas/set/setAsync.ts +++ b/library/src/schemas/set/setAsync.ts @@ -24,26 +24,34 @@ export type SetSchemaAsync< set: { value: TSetValue }; }; +/** + * Creates an async set schema. + * + * @param value The value schema. + * @param pipe A validation and transformation pipe. + * + * @returns An async set schema. + */ export function setAsync( value: TSetValue, pipe?: PipeAsync> ): SetSchemaAsync; -export function setAsync( - value: TSetValue, - error?: ErrorMessage, - pipe?: PipeAsync> -): SetSchemaAsync; - /** * Creates an async set schema. * * @param value The value schema. - * @param arg2 A validation and transformation pipe, or an error message. - * @param arg3 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An async set schema. */ +export function setAsync( + value: TSetValue, + error?: ErrorMessage, + pipe?: PipeAsync> +): SetSchemaAsync; + export function setAsync( value: TSetValue, arg2?: PipeAsync> | ErrorMessage, diff --git a/library/src/schemas/special/special.ts b/library/src/schemas/special/special.ts index 2c2b0087b..b7d8057cf 100644 --- a/library/src/schemas/special/special.ts +++ b/library/src/schemas/special/special.ts @@ -15,26 +15,34 @@ export type SpecialSchema = BaseSchema< schema: 'special'; }; +/** + * Creates a special schema. + * + * @param check The type check function. + * @param pipe A validation and transformation pipe. + * + * @returns A special schema. + */ export function special( check: (input: unknown) => boolean, pipe?: Pipe ): SpecialSchema; -export function special( - check: (input: unknown) => boolean, - error?: ErrorMessage, - pipe?: Pipe -): SpecialSchema; - /** * Creates a special schema. * * @param check The type check function. - * @param arg2 A validation and transformation pipe, or an error message. - * @param arg3 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns A special schema. */ +export function special( + check: (input: unknown) => boolean, + error?: ErrorMessage, + pipe?: Pipe +): SpecialSchema; + export function special( check: (input: unknown) => boolean, arg2?: Pipe | ErrorMessage, diff --git a/library/src/schemas/special/specialAsync.ts b/library/src/schemas/special/specialAsync.ts index f9cfd09c9..95c9dc29c 100644 --- a/library/src/schemas/special/specialAsync.ts +++ b/library/src/schemas/special/specialAsync.ts @@ -15,26 +15,34 @@ export type SpecialSchemaAsync = BaseSchemaAsync< schema: 'special'; }; +/** + * Creates an async special schema. + * + * @param check The type check function. + * @param pipe A validation and transformation pipe. + * + * @returns An async special schema. + */ export function specialAsync( check: (input: unknown) => boolean | Promise, pipe?: PipeAsync ): SpecialSchemaAsync; -export function specialAsync( - check: (input: unknown) => boolean | Promise, - error?: ErrorMessage, - pipe?: PipeAsync -): SpecialSchemaAsync; - /** * Creates a special schema. * * @param check The type check function. - * @param arg2 A validation and transformation pipe, or an error message. - * @param arg3 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * - * @returns An async special schema. + * @returns A special schema. */ +export function specialAsync( + check: (input: unknown) => boolean | Promise, + error?: ErrorMessage, + pipe?: PipeAsync +): SpecialSchemaAsync; + export function specialAsync( check: (input: unknown) => boolean | Promise, arg2?: PipeAsync | ErrorMessage, diff --git a/library/src/schemas/string/string.ts b/library/src/schemas/string/string.ts index 9aa170955..af4348daa 100644 --- a/library/src/schemas/string/string.ts +++ b/library/src/schemas/string/string.ts @@ -12,18 +12,25 @@ export type StringSchema = BaseSchema & { schema: 'string'; }; +/** + * Creates a string schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns A string schema. + */ export function string(pipe?: Pipe): StringSchema; -export function string(error?: ErrorMessage, pipe?: Pipe): StringSchema; - /** * Creates a string schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns A string schema. */ +export function string(error?: ErrorMessage, pipe?: Pipe): StringSchema; + export function string( arg1?: ErrorMessage | Pipe, arg2?: Pipe diff --git a/library/src/schemas/string/stringAsync.ts b/library/src/schemas/string/stringAsync.ts index c3bf357cc..20a715333 100644 --- a/library/src/schemas/string/stringAsync.ts +++ b/library/src/schemas/string/stringAsync.ts @@ -15,21 +15,28 @@ export type StringSchemaAsync = BaseSchemaAsync< schema: 'string'; }; +/** + * Creates an async string schema. + * + * @param pipe A validation and transformation pipe. + * + * @returns An async string schema. + */ export function stringAsync(pipe?: PipeAsync): StringSchemaAsync; -export function stringAsync( - error?: ErrorMessage, - pipe?: PipeAsync -): StringSchemaAsync; - /** * Creates an async string schema. * - * @param arg1 A validation and transformation pipe, or an error message. - * @param arg2 A validation and transformation pipe. + * @param error The error message. + * @param pipe A validation and transformation pipe. * * @returns An async string schema. */ +export function stringAsync( + error?: ErrorMessage, + pipe?: PipeAsync +): StringSchemaAsync; + export function stringAsync( arg1?: ErrorMessage | PipeAsync, arg2?: PipeAsync diff --git a/library/src/schemas/tuple/tuple.ts b/library/src/schemas/tuple/tuple.ts index d39dfa34c..7b90a3ab7 100644 --- a/library/src/schemas/tuple/tuple.ts +++ b/library/src/schemas/tuple/tuple.ts @@ -52,6 +52,15 @@ export function tuple( pipe?: Pipe> ): TupleSchema; +/** + * Creates a tuple schema. + * + * @param items The items schema. + * @param rest The rest schema. + * @param pipe A validation and transformation pipe. + * + * @returns A tuple schema. + */ export function tuple< TTupleItems extends TupleItems, TTupleRest extends BaseSchema | undefined @@ -61,6 +70,16 @@ export function tuple< pipe?: Pipe> ): TupleSchema; +/** + * Creates a tuple schema. + * + * @param items The items schema. + * @param rest The rest schema. + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns A tuple schema. + */ export function tuple< TTupleItems extends TupleItems, TTupleRest extends BaseSchema | undefined @@ -71,16 +90,6 @@ export function tuple< pipe?: Pipe> ): TupleSchema; -/** - * Creates a tuple schema. - * - * @param items The items schema. - * @param arg2 A validation and transformation pipe, or an error message, or the rest schema. - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. - * - * @returns A tuple schema. - */ export function tuple< TTupleItems extends TupleItems, TTupleRest extends BaseSchema | undefined = undefined diff --git a/library/src/schemas/tuple/tupleAsync.ts b/library/src/schemas/tuple/tupleAsync.ts index bd8a5cbe5..873d43ee5 100644 --- a/library/src/schemas/tuple/tupleAsync.ts +++ b/library/src/schemas/tuple/tupleAsync.ts @@ -61,6 +61,15 @@ export function tupleAsync( pipe?: PipeAsync> ): TupleSchemaAsync; +/** + * Creates an async tuple schema. + * + * @param items The items schema. + * @param rest The rest schema. + * @param pipe A validation and transformation pipe. + * + * @returns An async tuple schema. + */ export function tupleAsync< TTupleItems extends TupleItemsAsync, TTupleRest extends BaseSchema | BaseSchemaAsync | undefined @@ -70,6 +79,16 @@ export function tupleAsync< pipe?: PipeAsync> ): TupleSchemaAsync; +/** + * Creates an async tuple schema. + * + * @param items The items schema. + * @param rest The rest schema. + * @param error The error message. + * @param pipe A validation and transformation pipe. + * + * @returns An async tuple schema. + */ export function tupleAsync< TTupleItems extends TupleItemsAsync, TTupleRest extends BaseSchema | BaseSchemaAsync | undefined @@ -80,16 +99,6 @@ export function tupleAsync< pipe?: PipeAsync> ): TupleSchemaAsync; -/** - * Creates an async tuple schema. - * - * @param items The items schema. - * @param arg2 A validation and transformation pipe, or an error message, or the rest schema. - * @param arg3 A validation and transformation pipe, or an error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An async tuple schema. - */ export function tupleAsync< TTupleItems extends TupleItemsAsync, TTupleRest extends BaseSchema | BaseSchemaAsync | undefined = undefined From 478ac1944c17c953ae1c5ce335334542bbe8d2dd Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Sun, 29 Oct 2023 16:43:16 +0900 Subject: [PATCH 09/13] fix: revert the change --- library/src/error/flatten/flatten.ts | 18 +++++++++++++----- library/src/methods/merge/merge.ts | 4 ++-- library/src/schemas/object/objectAsync.ts | 10 ---------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/library/src/error/flatten/flatten.ts b/library/src/error/flatten/flatten.ts index c27e6540b..c0ec2bc11 100644 --- a/library/src/error/flatten/flatten.ts +++ b/library/src/error/flatten/flatten.ts @@ -123,20 +123,28 @@ export type FlatErrors = { nested: Partial, [string, ...string[]]>>; }; +/** + * Flatten the error messages of a Vali error. + * + * @param error A Vali error. + * + * @returns Flat errors. + */ export function flatten( error: ValiError ): FlatErrors; -export function flatten( - issues: Issues -): FlatErrors; - /** + * Flatten the error messages of a Vali error. * - * @param arg1 A Vali error or issues. + * @param issues The issues. * * @returns Flat errors. */ +export function flatten( + issues: Issues +): FlatErrors; + export function flatten( arg1: ValiError | Issues ): FlatErrors { diff --git a/library/src/methods/merge/merge.ts b/library/src/methods/merge/merge.ts index 1e2c0cdff..fefe78a44 100644 --- a/library/src/methods/merge/merge.ts +++ b/library/src/methods/merge/merge.ts @@ -31,8 +31,8 @@ export function merge( ): ObjectSchema>; /** - * Merges the entries of multiple async object schemas. Subsequent object - * entries overwrite the previous ones. + * Merges the entries of multiple object schemas. Subsequent object entries + * overwrite the previous ones. * * @param schemas The schemas to be merged. * @param error The error message. diff --git a/library/src/schemas/object/objectAsync.ts b/library/src/schemas/object/objectAsync.ts index e3f45a270..f787c0a32 100644 --- a/library/src/schemas/object/objectAsync.ts +++ b/library/src/schemas/object/objectAsync.ts @@ -96,16 +96,6 @@ export function objectAsync< pipe?: PipeAsync> ): ObjectSchemaAsync; -/** - * Creates an async object schema. - * - * @param entries The object entries. - * @param arg2 A validation and transformation pipe, or the error message, or the object rest. - * @param arg3 A validation and transformation pipe, or the error message. - * @param arg4 A validation and transformation pipe. - * - * @returns An async object schema. - */ export function objectAsync< TObjectEntries extends ObjectEntriesAsync, TObjectRest extends BaseSchema | BaseSchemaAsync | undefined = undefined From d7c2bf61516d6c04f036c179d70ffc01406cabfc Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Sun, 29 Oct 2023 16:44:17 +0900 Subject: [PATCH 10/13] fix: revert the change --- library/src/error/flatten/flatten.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/error/flatten/flatten.ts b/library/src/error/flatten/flatten.ts index c0ec2bc11..3bf64e9c8 100644 --- a/library/src/error/flatten/flatten.ts +++ b/library/src/error/flatten/flatten.ts @@ -135,7 +135,7 @@ export function flatten( ): FlatErrors; /** - * Flatten the error messages of a Vali error. + * Flatten the error messages of issues. * * @param issues The issues. * From 3d36da387c8febeab5f4d79b1ba3b3d8e2241b4b Mon Sep 17 00:00:00 2001 From: kazizi55 Date: Sun, 29 Oct 2023 16:47:57 +0900 Subject: [PATCH 11/13] fix: move the JSDocs to the top --- library/src/methods/brand/brand.ts | 16 +++++++-------- library/src/methods/transform/transform.ts | 20 +++++++++---------- .../src/methods/transform/transformAsync.ts | 20 +++++++++---------- library/src/validations/excludes/excludes.ts | 16 +++++++-------- library/src/validations/includes/includes.ts | 16 +++++++-------- 5 files changed, 44 insertions(+), 44 deletions(-) diff --git a/library/src/methods/brand/brand.ts b/library/src/methods/brand/brand.ts index bbf412c29..2bfd37677 100644 --- a/library/src/methods/brand/brand.ts +++ b/library/src/methods/brand/brand.ts @@ -89,6 +89,14 @@ export type Brand = { [BrandSymbol]: { [TValue in TBrandName]: TValue }; }; +/** + * Brands the output type of a schema. + * + * @param schema The schema to be branded. + * @param name The branded name. + * + * @returns The branded schema. + */ export function brand( schema: TSchema, name: TBrandName @@ -685,14 +693,6 @@ export function brand< name: TBrandName ): VoidSchemaAsync & Brand>; -/** - * Brands the output type of a schema. - * - * @param schema The schema to be branded. - * @param name The branded name. - * - * @returns The branded schema. - */ export function brand< TSchema extends BaseSchema | BaseSchemaAsync, TBrandName extends BrandName diff --git a/library/src/methods/transform/transform.ts b/library/src/methods/transform/transform.ts index 9ca7ca1a7..fed72cf59 100644 --- a/library/src/methods/transform/transform.ts +++ b/library/src/methods/transform/transform.ts @@ -37,6 +37,16 @@ import type { import type { BaseSchema, Input, Output, Pipe } from '../../types.ts'; import { executePipe } from '../../utils/index.ts'; +/** + * Adds a transformation step to a schema, which is executed at the end of + * parsing and can change the output type. + * + * @param schema The schema to be used. + * @param action The transformation action. + * @param pipe A validation pipe. + * + * @returns A transformed schema. + */ export function transform( schema: TSchema, action: (value: Output) => TOutput, @@ -244,16 +254,6 @@ export function transform( pipe?: Pipe ): VoidSchema; -/** - * Adds a transformation step to a schema, which is executed at the end of - * parsing and can change the output type. - * - * @param schema The schema to be used. - * @param action The transformation action. - * @param pipe A validation pipe. - * - * @returns A transformed schema. - */ export function transform( schema: TSchema, action: (value: Output) => TOutput, diff --git a/library/src/methods/transform/transformAsync.ts b/library/src/methods/transform/transformAsync.ts index 1156341c0..251c32aa1 100644 --- a/library/src/methods/transform/transformAsync.ts +++ b/library/src/methods/transform/transformAsync.ts @@ -77,6 +77,16 @@ import type { } from '../../types.ts'; import { executePipeAsync } from '../../utils/index.ts'; +/** + * Adds an async transformation step to a schema, which is executed at the end + * of parsing and can change the output type. + * + * @param schema The schema to be used. + * @param action The transformation action. + * @param pipe A validation pipe. + * + * @returns A transformed schema. + */ export function transformAsync< TSchema extends AnySchema | AnySchemaAsync, TOutput @@ -391,16 +401,6 @@ export function transformAsync< pipe?: PipeAsync ): VoidSchemaAsync; -/** - * Adds an async transformation step to a schema, which is executed at the end - * of parsing and can change the output type. - * - * @param schema The schema to be used. - * @param action The transformation action. - * @param pipe A validation pipe. - * - * @returns A transformed schema. - */ export function transformAsync< TSchema extends BaseSchema | BaseSchemaAsync, TOutput diff --git a/library/src/validations/excludes/excludes.ts b/library/src/validations/excludes/excludes.ts index a20140d78..66e0719dd 100644 --- a/library/src/validations/excludes/excludes.ts +++ b/library/src/validations/excludes/excludes.ts @@ -1,6 +1,14 @@ import type { ErrorMessage, PipeResult } from '../../types.ts'; import { getOutput, getPipeIssues } from '../../utils/index.ts'; +/** + * Creates a validation function that validates the content of a string or array. + * + * @param requirement The content to be excluded. + * @param error The error message. + * + * @returns A validation function. + */ export function excludes( requirement: string, error?: ErrorMessage @@ -11,14 +19,6 @@ export function excludes( error?: ErrorMessage ): (input: TInput) => PipeResult; -/** - * Creates a validation function that validates the content of a string or array. - * - * @param requirement The content to be excluded. - * @param error The error message. - * - * @returns A validation function. - */ export function excludes( requirement: string | TItem, error?: ErrorMessage diff --git a/library/src/validations/includes/includes.ts b/library/src/validations/includes/includes.ts index f8dd720ae..6324b9ac9 100644 --- a/library/src/validations/includes/includes.ts +++ b/library/src/validations/includes/includes.ts @@ -1,6 +1,14 @@ import type { ErrorMessage, PipeResult } from '../../types.ts'; import { getOutput, getPipeIssues } from '../../utils/index.ts'; +/** + * Creates a validation function that validates the content of a string or array. + * + * @param requirement The content to be included. + * @param error The error message. + * + * @returns A validation function. + */ export function includes( requirement: string, error?: ErrorMessage @@ -11,14 +19,6 @@ export function includes( error?: ErrorMessage ): (input: TInput) => PipeResult; -/** - * Creates a validation function that validates the content of a string or array. - * - * @param requirement The content to be included. - * @param error The error message. - * - * @returns A validation function. - */ export function includes( requirement: string | TItem, error?: ErrorMessage From 133ef6c9304d5f9e17a1fa6cb0c706ac43a16591 Mon Sep 17 00:00:00 2001 From: Fabian Hiller Date: Sat, 18 Nov 2023 22:31:11 -0500 Subject: [PATCH 12/13] Fix JSDoc errors after merge with main --- library/src/methods/brand/brand.ts | 8 ++++++++ library/src/methods/transform/transform.ts | 10 ++++++++++ library/src/methods/transform/transformAsync.ts | 10 ++++++++++ library/src/schemas/nullish/nullish.ts | 1 - library/src/schemas/union/unionAsync.ts | 2 +- library/src/types/pipe.ts | 16 ++++++++-------- library/src/types/schema.ts | 12 ++++++------ library/src/utils/getPipeIssues/getPipeIssues.ts | 1 + 8 files changed, 44 insertions(+), 16 deletions(-) diff --git a/library/src/methods/brand/brand.ts b/library/src/methods/brand/brand.ts index 2a17cc9df..9fa6781f0 100644 --- a/library/src/methods/brand/brand.ts +++ b/library/src/methods/brand/brand.ts @@ -35,6 +35,14 @@ export type SchemaWithBrand< }; }; +/** + * Brands the output type of a schema. + * + * @param schema The scheme to be branded. + * @param name The brand name. + * + * @returns The branded schema. + */ export function brand< TSchema extends BaseSchema | BaseSchemaAsync, TName extends BrandName diff --git a/library/src/methods/transform/transform.ts b/library/src/methods/transform/transform.ts index 6b1016db2..33b478f30 100644 --- a/library/src/methods/transform/transform.ts +++ b/library/src/methods/transform/transform.ts @@ -14,6 +14,16 @@ export type SchemaWithTransform = Omit< }; }; +/** + * Adds a transformation step to a schema, which is executed at the end of + * parsing and can change the output type. + * + * @param schema The schema to be used. + * @param action The transformation action. + * @param pipe A validation pipe. + * + * @returns A transformed schema. + */ export function transform( schema: TSchema, action: (value: Output) => TOutput, diff --git a/library/src/methods/transform/transformAsync.ts b/library/src/methods/transform/transformAsync.ts index c04eef7f8..2cd557604 100644 --- a/library/src/methods/transform/transformAsync.ts +++ b/library/src/methods/transform/transformAsync.ts @@ -24,6 +24,16 @@ export type SchemaWithTransformAsync< }; }; +/** + * Adds an async transformation step to a schema, which is executed at the end + * of parsing and can change the output type. + * + * @param schema The schema to be used. + * @param action The transformation action. + * @param pipe A validation pipe. + * + * @returns A transformed schema. + */ export function transformAsync< TSchema extends BaseSchema | BaseSchemaAsync, TOutput diff --git a/library/src/schemas/nullish/nullish.ts b/library/src/schemas/nullish/nullish.ts index 91ca5ea2d..cb872cad4 100644 --- a/library/src/schemas/nullish/nullish.ts +++ b/library/src/schemas/nullish/nullish.ts @@ -33,7 +33,6 @@ export type NullishSchema< * Creates a nullish schema. * * @param wrapped The wrapped schema. - * @param default_ The default value. * * @returns A nullish schema. */ diff --git a/library/src/schemas/union/unionAsync.ts b/library/src/schemas/union/unionAsync.ts index 81869d910..59557380a 100644 --- a/library/src/schemas/union/unionAsync.ts +++ b/library/src/schemas/union/unionAsync.ts @@ -41,7 +41,7 @@ export type UnionSchemaAsync< /** * Creates an async union schema. * - * @param union The union options. + * @param options The union options. * @param message The error message. * * @returns An async union schema. diff --git a/library/src/types/pipe.ts b/library/src/types/pipe.ts index 108626771..e6c4c12ea 100644 --- a/library/src/types/pipe.ts +++ b/library/src/types/pipe.ts @@ -47,11 +47,11 @@ export type BaseValidation = { /** * Parses unknown input based on its requirement. * - * @internal This is an internal API. - * * @param input The input to be parsed. * * @returns The parse result. + * + * @internal */ _parse(input: TInput): PipeResult; }; @@ -71,11 +71,11 @@ export type BaseValidationAsync = { /** * Parses unknown input based on its requirement. * - * @internal This is an internal API. - * * @param input The input to be parsed. * * @returns The parse result. + * + * @internal */ _parse(input: TInput): Promise>; }; @@ -91,11 +91,11 @@ export type BaseTransformation = { /** * Parses unknown input based on its requirement. * - * @internal This is an internal API. - * * @param input The input to be parsed. * * @returns The parse result. + * + * @internal */ _parse(input: TInput): PipeResult; }; @@ -111,11 +111,11 @@ export type BaseTransformationAsync = { /** * Parses unknown input based on its requirement. * - * @internal This is an internal API. - * * @param input The input to be parsed. * * @returns The parse result. + * + * @internal */ _parse(input: TInput): Promise>; }; diff --git a/library/src/types/schema.ts b/library/src/types/schema.ts index 0209dad0f..41f8ae441 100644 --- a/library/src/types/schema.ts +++ b/library/src/types/schema.ts @@ -43,18 +43,18 @@ export type BaseSchema = { /** * Parses unknown input based on its schema. * - * @internal This is an internal API. - * * @param input The input to be parsed. * @param info The parse info. * * @returns The parse result. + * + * @internal */ _parse(input: unknown, info?: ParseInfo): _ParseResult; /** * Input and output type. * - * @internal This is an internal API. + * @internal */ _types?: { input: TInput; output: TOutput }; }; @@ -70,18 +70,18 @@ export type BaseSchemaAsync = { /** * Parses unknown input based on its schema. * - * @internal This is an internal API. - * * @param input The input to be parsed. * @param info The parse info. * * @returns The parse result. + * + * @internal */ _parse(input: unknown, info?: ParseInfo): Promise<_ParseResult>; /** * Input and output type. * - * @internal This is an internal API. + * @internal */ _types?: { input: TInput; output: TOutput }; }; diff --git a/library/src/utils/getPipeIssues/getPipeIssues.ts b/library/src/utils/getPipeIssues/getPipeIssues.ts index 23b0cc7f2..20a6cc1bb 100644 --- a/library/src/utils/getPipeIssues/getPipeIssues.ts +++ b/library/src/utils/getPipeIssues/getPipeIssues.ts @@ -8,6 +8,7 @@ import { getIssues } from '../getIssues/getIssues.ts'; * @param validation The validation name. * @param message The error message. * @param input The input value. + * @param requirement The requirement. * * @returns The pipeline result object. */ From b9cd7a77d9059048126cbd86eec4ce2310c144de Mon Sep 17 00:00:00 2001 From: Fabian Hiller Date: Sat, 18 Nov 2023 22:36:33 -0500 Subject: [PATCH 13/13] Refactor ESLint config and update changelog --- library/.eslintrc.cjs | 41 ++++++++++++++++++++++++++++------------- library/CHANGELOG.md | 1 + 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/library/.eslintrc.cjs b/library/.eslintrc.cjs index edbb8798c..07fca9395 100644 --- a/library/.eslintrc.cjs +++ b/library/.eslintrc.cjs @@ -41,23 +41,38 @@ module.exports = { '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/consistent-type-imports': 'warn', '@typescript-eslint/no-non-null-assertion': 'off', + + // Imports 'no-duplicate-imports': 'off', 'import/extensions': ['error', 'always'], - 'jsdoc/tag-lines': ['error', 'any', { - 'startLines': 1, - }], - 'jsdoc/sort-tags': ['error', { 'linesBetween': 1, "tagSequence": [{ "tags": ["deprecated"] }, { "tags": ["param"] }, { "tags": ["returns"] }] }], + + // JSDoc + 'jsdoc/tag-lines': ['error', 'any', { startLines: 1 }], + 'jsdoc/sort-tags': [ + 'error', + { + linesBetween: 1, + tagSequence: [ + { tags: ['deprecated'] }, + { tags: ['param'] }, + { tags: ['returns'] }, + ], + }, + ], // NOTE: For overloads functions, we only require a JSDoc at the top // SEE: https://github.com/gajus/eslint-plugin-jsdoc/issues/666 - "jsdoc/require-jsdoc": ["error", { - "contexts": [ - 'ExportNamedDeclaration[declaration.type="TSDeclareFunction"]:not(ExportNamedDeclaration[declaration.type="TSDeclareFunction"] + ExportNamedDeclaration[declaration.type="TSDeclareFunction"])', - 'ExportNamedDeclaration[declaration.type="FunctionDeclaration"]:not(ExportNamedDeclaration[declaration.type="TSDeclareFunction"] + ExportNamedDeclaration[declaration.type="FunctionDeclaration"])', - ], - "require": { - "FunctionDeclaration": false - } - }], + 'jsdoc/require-jsdoc': [ + 'error', + { + contexts: [ + 'ExportNamedDeclaration[declaration.type="TSDeclareFunction"]:not(ExportNamedDeclaration[declaration.type="TSDeclareFunction"] + ExportNamedDeclaration[declaration.type="TSDeclareFunction"])', + 'ExportNamedDeclaration[declaration.type="FunctionDeclaration"]:not(ExportNamedDeclaration[declaration.type="TSDeclareFunction"] + ExportNamedDeclaration[declaration.type="FunctionDeclaration"])', + ], + require: { + FunctionDeclaration: false, + }, + }, + ], // Security 'security/detect-object-injection': 'off', // Too many false positives diff --git a/library/CHANGELOG.md b/library/CHANGELOG.md index 1ca9e632e..4d6eb9e4d 100644 --- a/library/CHANGELOG.md +++ b/library/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to the library will be documented in this file. ## vX.X.X (Month DD, YYYY) - Change structure of schemas, validations and transformations to make properties accessible (pull request #211) +- Fix errors in JSDoc comments and add JSDoc ESLint plugin (pull request #205) ## v0.20.1 (November 2, 2023)