Skip to content

Commit

Permalink
Merge pull request #59 from rctay/master
Browse files Browse the repository at this point in the history
Add to Options typings, document and add typings for startAt options
  • Loading branch information
jackbearheart committed May 19, 2021
2 parents 5d98276 + 1d8eb02 commit ce83ee2
Show file tree
Hide file tree
Showing 2 changed files with 16 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
16 changes: 15 additions & 1 deletion lib/email-addresses.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,29 @@ 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;
addressListSeparator?: string;
}

interface ParsedResult {
Expand Down

0 comments on commit ce83ee2

Please sign in to comment.