Skip to content

Commit

Permalink
Document and add typings for startAt options
Browse files Browse the repository at this point in the history
  • Loading branch information
rctay committed May 16, 2021
1 parent c6cc738 commit 1d8eb02
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Options:
* `simple` - Return just the address or addresses parsed. Default: `false`.
* `strict` - Turn off features of RFC 5322 marked "Obsolete". Default: `false`.
* `rejectTLD` - Require at least one `.` in domain names. Default: `false`.
* `startAt` - Start the parser at one of `address-list`, `from`, `sender`, `reply-to`. Default: `address-list`.
* `startAt` - Start the parser at one of `address`, `address-list`, `angle-addr`, `from`, `group`, `mailbox`, `mailbox-list`, `reply-to`, `sender`. Default: `address-list`.
* `atInDisplayName` - Allow the `@` character in the display name of the email address. Default: `false`.
* `commaInDisplayName` - Allow the `,` character in the display name of the email address. Default: `false`.
* `addressListSeparator` - Specifies the character separating the list of email addresses. Default: `,`.
Expand Down
13 changes: 12 additions & 1 deletion lib/email-addresses.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,25 @@ declare module emailAddresses {
children: ASTNode[];
}

type StartProductions =
"address"
| "address-list"
| "angle-addr"
| "from"
| "group"
| "mailbox"
| "mailbox-list"
| "reply-to"
| "sender";

interface Options {
input: string;
oneResult?: boolean;
partial?: boolean;
rejectTLD?: boolean;
rfc6532?: boolean;
simple?: boolean;
startAt?: string;
startAt?: StartProductions;
strict?: boolean;
atInDisplayName?: boolean;
commaInDisplayName?: boolean;
Expand Down

0 comments on commit 1d8eb02

Please sign in to comment.