-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
774 additions
and
182 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
...-validators.optionserror._constructor_.md → ...ors.emailvalidationerror._constructor_.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
apps/docs/api/starter-kitty-validators.emailvalidationerror.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [EmailValidationError](./starter-kitty-validators.emailvalidationerror.md) | ||
|
||
## EmailValidationError class | ||
|
||
Invalid email error. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare class EmailValidationError extends Error | ||
``` | ||
**Extends:** Error | ||
## Constructors | ||
<table><thead><tr><th> | ||
Constructor | ||
</th><th> | ||
Modifiers | ||
</th><th> | ||
Description | ||
</th></tr></thead> | ||
<tbody><tr><td> | ||
[(constructor)(message)](./starter-kitty-validators.emailvalidationerror._constructor_.md) | ||
</td><td> | ||
</td><td> | ||
Constructs a new instance of the `EmailValidationError` class | ||
</td></tr> | ||
</tbody></table> |
49 changes: 49 additions & 0 deletions
49
apps/docs/api/starter-kitty-validators.emailvalidator._constructor_.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [EmailValidator](./starter-kitty-validators.emailvalidator.md) > [(constructor)](./starter-kitty-validators.emailvalidator._constructor_.md) | ||
|
||
## EmailValidator.(constructor) | ||
|
||
Constructs a new instance of the `EmailValidator` class | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
constructor(options?: EmailValidatorOptions); | ||
``` | ||
|
||
## Parameters | ||
|
||
<table><thead><tr><th> | ||
|
||
Parameter | ||
|
||
|
||
</th><th> | ||
|
||
Type | ||
|
||
|
||
</th><th> | ||
|
||
Description | ||
|
||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
options | ||
|
||
|
||
</td><td> | ||
|
||
[EmailValidatorOptions](./starter-kitty-validators.emailvalidatoroptions.md) | ||
|
||
|
||
</td><td> | ||
|
||
_(Optional)_ | ||
|
||
|
||
</td></tr> | ||
</tbody></table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [EmailValidator](./starter-kitty-validators.emailvalidator.md) | ||
|
||
## EmailValidator class | ||
|
||
Validates emails against RFC 5322 and a whitelist of domains. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare class EmailValidator | ||
``` | ||
|
||
## Constructors | ||
|
||
<table><thead><tr><th> | ||
|
||
Constructor | ||
|
||
|
||
</th><th> | ||
|
||
Modifiers | ||
|
||
|
||
</th><th> | ||
|
||
Description | ||
|
||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
[(constructor)(options)](./starter-kitty-validators.emailvalidator._constructor_.md) | ||
|
||
|
||
</td><td> | ||
|
||
|
||
</td><td> | ||
|
||
Constructs a new instance of the `EmailValidator` class | ||
|
||
|
||
</td></tr> | ||
</tbody></table> | ||
|
||
## Methods | ||
|
||
<table><thead><tr><th> | ||
|
||
Method | ||
|
||
|
||
</th><th> | ||
|
||
Modifiers | ||
|
||
|
||
</th><th> | ||
|
||
Description | ||
|
||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
[parse(email)](./starter-kitty-validators.emailvalidator.parse.md) | ||
|
||
|
||
</td><td> | ||
|
||
|
||
</td><td> | ||
|
||
Parses an email address string. | ||
|
||
|
||
</td></tr> | ||
</tbody></table> |
58 changes: 58 additions & 0 deletions
58
apps/docs/api/starter-kitty-validators.emailvalidator.parse.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [EmailValidator](./starter-kitty-validators.emailvalidator.md) > [parse](./starter-kitty-validators.emailvalidator.parse.md) | ||
|
||
## EmailValidator.parse() method | ||
|
||
Parses an email address string. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
parse(email: string): string; | ||
``` | ||
|
||
## Parameters | ||
|
||
<table><thead><tr><th> | ||
|
||
Parameter | ||
|
||
|
||
</th><th> | ||
|
||
Type | ||
|
||
|
||
</th><th> | ||
|
||
Description | ||
|
||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
|
||
|
||
</td><td> | ||
|
||
string | ||
|
||
|
||
</td><td> | ||
|
||
The email to validate | ||
|
||
|
||
</td></tr> | ||
</tbody></table> | ||
**Returns:** | ||
|
||
string | ||
|
||
|
||
## Exceptions | ||
|
||
[EmailValidationError](./starter-kitty-validators.emailvalidationerror.md) If the email is invalid | ||
|
18 changes: 18 additions & 0 deletions
18
apps/docs/api/starter-kitty-validators.emailvalidatoroptions.allowsubdomains.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [EmailValidatorOptions](./starter-kitty-validators.emailvalidatoroptions.md) > [allowSubdomains](./starter-kitty-validators.emailvalidatoroptions.allowsubdomains.md) | ||
|
||
## EmailValidatorOptions.allowSubdomains property | ||
|
||
Whether subdomains are allowed. Defaults to `true`<!-- -->. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
allowSubdomains?: boolean; | ||
``` | ||
|
||
## Example | ||
|
||
If `false`<!-- -->, `open.gov.sg` is not allowed, even if `gov.sg` is in the whitelist. | ||
|
18 changes: 18 additions & 0 deletions
18
apps/docs/api/starter-kitty-validators.emailvalidatoroptions.domains.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [EmailValidatorOptions](./starter-kitty-validators.emailvalidatoroptions.md) > [domains](./starter-kitty-validators.emailvalidatoroptions.domains.md) | ||
|
||
## EmailValidatorOptions.domains property | ||
|
||
The list of allowed domains for the domain part of the email address. If not provided, all domains are allowed. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
domains?: string[]; | ||
``` | ||
|
||
## Example | ||
|
||
`[ 'gov.sg', 'example.com' ]` | ||
|
76 changes: 76 additions & 0 deletions
76
apps/docs/api/starter-kitty-validators.emailvalidatoroptions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [EmailValidatorOptions](./starter-kitty-validators.emailvalidatoroptions.md) | ||
|
||
## EmailValidatorOptions interface | ||
|
||
The options to use for email validation. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface EmailValidatorOptions | ||
``` | ||
|
||
## Properties | ||
|
||
<table><thead><tr><th> | ||
|
||
Property | ||
|
||
|
||
</th><th> | ||
|
||
Modifiers | ||
|
||
|
||
</th><th> | ||
|
||
Type | ||
|
||
|
||
</th><th> | ||
|
||
Description | ||
|
||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
[allowSubdomains?](./starter-kitty-validators.emailvalidatoroptions.allowsubdomains.md) | ||
|
||
|
||
</td><td> | ||
|
||
|
||
</td><td> | ||
|
||
boolean | ||
|
||
|
||
</td><td> | ||
|
||
_(Optional)_ Whether subdomains are allowed. Defaults to `true`<!-- -->. | ||
|
||
|
||
</td></tr> | ||
<tr><td> | ||
|
||
[domains?](./starter-kitty-validators.emailvalidatoroptions.domains.md) | ||
|
||
|
||
</td><td> | ||
|
||
|
||
</td><td> | ||
|
||
string\[\] | ||
|
||
|
||
</td><td> | ||
|
||
_(Optional)_ The list of allowed domains for the domain part of the email address. If not provided, all domains are allowed. | ||
|
||
|
||
</td></tr> | ||
</tbody></table> |
Oops, something went wrong.