diff --git a/README.md b/README.md index 65910ae..eb2ec65 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ You can define any custom Guard with [`TValidate`](/docs/modules.md#tvalidate). Defining a guard that validates if a number is bigger than 10: ```ts -const TNumberBiggerThan10 = TValidate( +const TNumberBiggerThan10 = TValidate( "number(bigger than 10)", (value) => typeof value === "number" && value > 10 ); diff --git a/docs/README.md b/docs/README.md index daa6528..c8f95b1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -161,7 +161,7 @@ You can define any custom Guard with [`TValidate`](/docs/modules.md#tvalidate). Defining a guard that validates if a number is bigger than 10: ```ts -const TNumberBiggerThan10 = TValidate( +const TNumberBiggerThan10 = TValidate( "number(bigger than 10)", (value) => typeof value === "number" && value > 10 ); diff --git a/docs/classes/Guard.md b/docs/classes/Guard.md index c143453..293abbb 100644 --- a/docs/classes/Guard.md +++ b/docs/classes/Guard.md @@ -47,7 +47,7 @@ An abstract class, which is the parent class of all Guards. (Names starting with #### Defined in -[src/Guard.ts:11](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/Guard.ts#L11) +[src/Guard.ts:11](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/Guard.ts#L11) ## Methods @@ -67,7 +67,7 @@ An abstract class, which is the parent class of all Guards. (Names starting with #### Defined in -[src/Guard.ts:13](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/Guard.ts#L13) +[src/Guard.ts:13](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/Guard.ts#L13) ___ @@ -87,4 +87,4 @@ value is T #### Defined in -[src/Guard.ts:12](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/Guard.ts#L12) +[src/Guard.ts:12](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/Guard.ts#L12) diff --git a/docs/classes/ValidationError.md b/docs/classes/ValidationError.md index 8823660..fada9f0 100644 --- a/docs/classes/ValidationError.md +++ b/docs/classes/ValidationError.md @@ -48,7 +48,7 @@ Error.constructor #### Defined in -[src/errors.ts:5](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/errors.ts#L5) +[src/errors.ts:5](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/errors.ts#L5) ## Properties @@ -58,7 +58,7 @@ Error.constructor #### Defined in -[src/errors.ts:3](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/errors.ts#L3) +[src/errors.ts:3](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/errors.ts#L3) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[src/errors.ts:2](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/errors.ts#L2) +[src/errors.ts:2](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/errors.ts#L2) ___ diff --git a/docs/modules.md b/docs/modules.md index 4eb4317..739181e 100644 --- a/docs/modules.md +++ b/docs/modules.md @@ -68,7 +68,7 @@ Infers the type, that the given `Guard` guards. #### Defined in -[src/Guard.ts:22](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/Guard.ts#L22) +[src/Guard.ts:22](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/Guard.ts#L22) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[src/guards/TObject/types.ts:16](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TObject/types.ts#L16) +[src/guards/TObject/types.ts:16](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TObject/types.ts#L16) ## Variables @@ -96,7 +96,7 @@ Guard that accepts any value. #### Defined in -[src/guards/TAny/index.ts:8](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TAny/index.ts#L8) +[src/guards/TAny/index.ts:8](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TAny/index.ts#L8) ___ @@ -111,7 +111,7 @@ Does not accept null. #### Defined in -[src/guards/TAnyObject/index.ts:9](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TAnyObject/index.ts#L9) +[src/guards/TAnyObject/index.ts:9](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TAnyObject/index.ts#L9) ___ @@ -125,7 +125,7 @@ Primitive guard that only accepts `bigint` values. #### Defined in -[src/guards/TBigInt/index.ts:8](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TBigInt/index.ts#L8) +[src/guards/TBigInt/index.ts:8](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TBigInt/index.ts#L8) ___ @@ -139,7 +139,7 @@ Primitive guard that only accepts `boolean` values. #### Defined in -[src/guards/TBoolean/index.ts:8](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TBoolean/index.ts#L8) +[src/guards/TBoolean/index.ts:8](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TBoolean/index.ts#L8) ___ @@ -153,7 +153,7 @@ Primitive guard that only accepts `function` values. #### Defined in -[src/guards/TFunction/index.ts:8](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TFunction/index.ts#L8) +[src/guards/TFunction/index.ts:8](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TFunction/index.ts#L8) ___ @@ -174,7 +174,7 @@ TInteger.isValid(15); // true #### Defined in -[src/guards/TInteger/index.ts:15](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TInteger/index.ts#L15) +[src/guards/TInteger/index.ts:15](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TInteger/index.ts#L15) ___ @@ -195,7 +195,7 @@ TIntegerAsString.isValid("15"); // true #### Defined in -[src/guards/TIntegerAsString/index.ts:16](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TIntegerAsString/index.ts#L16) +[src/guards/TIntegerAsString/index.ts:16](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TIntegerAsString/index.ts#L16) ___ @@ -209,7 +209,7 @@ Guard that only accepts `null`. #### Defined in -[src/guards/TNull/index.ts:8](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TNull/index.ts#L8) +[src/guards/TNull/index.ts:8](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TNull/index.ts#L8) ___ @@ -224,7 +224,7 @@ Not accepts `NaN`. #### Defined in -[src/guards/TNumber/index.ts:9](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TNumber/index.ts#L9) +[src/guards/TNumber/index.ts:9](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TNumber/index.ts#L9) ___ @@ -245,7 +245,7 @@ TNumberAsString.isValid("15.223"); // true #### Defined in -[src/guards/TNumberAsString/index.ts:15](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TNumberAsString/index.ts#L15) +[src/guards/TNumberAsString/index.ts:15](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TNumberAsString/index.ts#L15) ___ @@ -259,7 +259,7 @@ Primitive guard that only accepts `string` values. #### Defined in -[src/guards/TString/index.ts:8](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TString/index.ts#L8) +[src/guards/TString/index.ts:8](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TString/index.ts#L8) ___ @@ -280,7 +280,7 @@ TStringEmail.name === "string(email)"; // true #### Defined in -[src/guards/TStringEmail/index.ts:16](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringEmail/index.ts#L16) +[src/guards/TStringEmail/index.ts:16](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringEmail/index.ts#L16) ___ @@ -301,7 +301,7 @@ TStringISODate.name === "string(date)"; // true #### Defined in -[src/guards/TStringISODate/index.ts:16](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringISODate/index.ts#L16) +[src/guards/TStringISODate/index.ts:16](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringISODate/index.ts#L16) ___ @@ -322,7 +322,7 @@ TStringJSON.name === "string(JSON)"; // true #### Defined in -[src/guards/TStringJSON/index.ts:16](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringJSON/index.ts#L16) +[src/guards/TStringJSON/index.ts:16](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringJSON/index.ts#L16) ___ @@ -343,7 +343,7 @@ TStringJWT.name === "string(JSON)"; // true #### Defined in -[src/guards/TStringJWT/index.ts:16](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringJWT/index.ts#L16) +[src/guards/TStringJWT/index.ts:16](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringJWT/index.ts#L16) ___ @@ -364,7 +364,7 @@ TStringMIMEType.name === "string(MIME type)"; // true #### Defined in -[src/guards/TStringMIMEType/index.ts:16](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringMIMEType/index.ts#L16) +[src/guards/TStringMIMEType/index.ts:16](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringMIMEType/index.ts#L16) ___ @@ -386,7 +386,7 @@ TStringPhoneNumber.name === "string(phone number)"; // true #### Defined in -[src/guards/TStringPhoneNumber/index.ts:17](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringPhoneNumber/index.ts#L17) +[src/guards/TStringPhoneNumber/index.ts:17](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringPhoneNumber/index.ts#L17) ___ @@ -407,7 +407,7 @@ TStringSemVer.name === "string(SemVer)"; // true #### Defined in -[src/guards/TStringSemVer/index.ts:16](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringSemVer/index.ts#L16) +[src/guards/TStringSemVer/index.ts:16](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringSemVer/index.ts#L16) ___ @@ -428,7 +428,7 @@ TStringURL.name === "string(URL)"; // true #### Defined in -[src/guards/TStringURL/index.ts:16](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringURL/index.ts#L16) +[src/guards/TStringURL/index.ts:16](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringURL/index.ts#L16) ___ @@ -452,7 +452,7 @@ TStringUUID.name === "string(UUID)"; // true #### Defined in -[src/guards/TStringUUID/index.ts:19](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringUUID/index.ts#L19) +[src/guards/TStringUUID/index.ts:19](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringUUID/index.ts#L19) ___ @@ -466,7 +466,7 @@ Primitive guard that only accepts `undefined` values. #### Defined in -[src/guards/TUndefined/index.ts:8](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TUndefined/index.ts#L8) +[src/guards/TUndefined/index.ts:8](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TUndefined/index.ts#L8) ## Functions @@ -503,7 +503,7 @@ Accepts a value when it was accepted by all `guardA` and `guardB`, and others. #### Defined in -[src/guards/TAnd/index.ts:14](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TAnd/index.ts#L14) +[src/guards/TAnd/index.ts:14](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TAnd/index.ts#L14) ___ @@ -546,7 +546,7 @@ A `Guard` that checks if the given value is an array of the given type. #### Defined in -[src/guards/TArray/index.ts:24](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TArray/index.ts#L24) +[src/guards/TArray/index.ts:24](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TArray/index.ts#L24) ___ @@ -589,7 +589,7 @@ A `Guard` which checks if the given value is equals to the `constant` literal. #### Defined in -[src/guards/TConstant/index.ts:26](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TConstant/index.ts#L26) +[src/guards/TConstant/index.ts:26](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TConstant/index.ts#L26) ___ @@ -628,7 +628,7 @@ A `Guard` that accepts a value when it was **not** accepted by the given guard. #### Defined in -[src/guards/TNot/index.ts:21](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TNot/index.ts#L21) +[src/guards/TNot/index.ts:21](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TNot/index.ts#L21) ___ @@ -676,7 +676,7 @@ A `Guard`. #### Defined in -[src/guards/TObject/index.ts:31](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TObject/index.ts#L31) +[src/guards/TObject/index.ts:31](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TObject/index.ts#L31) ___ @@ -734,7 +734,7 @@ Similar in concept as TypeScript's `{[keys: string]: number}` type annotations. #### Defined in -[src/guards/TObjectOfShape/index.ts:39](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TObjectOfShape/index.ts#L39) +[src/guards/TObjectOfShape/index.ts:39](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TObjectOfShape/index.ts#L39) ___ @@ -780,7 +780,7 @@ Accepts a value when it was accepted by at least one of the `guards`. #### Defined in -[src/guards/TOr/index.ts:22](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TOr/index.ts#L22) +[src/guards/TOr/index.ts:22](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TOr/index.ts#L22) ___ @@ -814,7 +814,7 @@ A `Guard` that accepts only strings that are base64 encoded. #### Defined in -[src/guards/TStringBase64/index.ts:21](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringBase64/index.ts#L21) +[src/guards/TStringBase64/index.ts:21](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringBase64/index.ts#L21) ___ @@ -849,7 +849,7 @@ A `Guard` that accepts only strings that matches the given `regexp`. #### Defined in -[src/guards/TStringMatch/index.ts:23](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringMatch/index.ts#L23) +[src/guards/TStringMatch/index.ts:23](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringMatch/index.ts#L23) ___ @@ -884,7 +884,7 @@ A `Guard` that accepts only strings, that is in the given length range. #### Defined in -[src/guards/TStringWithLength/index.ts:22](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TStringWithLength/index.ts#L22) +[src/guards/TStringWithLength/index.ts:22](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TStringWithLength/index.ts#L22) ___ @@ -922,4 +922,4 @@ const TBiggerThan10 = TValidate( #### Defined in -[src/guards/TValidate/index.ts:22](https://github.com/davidkarolyi/tguard/blob/d84cda9/src/guards/TValidate/index.ts#L22) +[src/guards/TValidate/index.ts:22](https://github.com/davidkarolyi/tguard/blob/f2e7a9f/src/guards/TValidate/index.ts#L22)