Skip to content

Commit

Permalink
update type getonlyemail
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed Aug 21, 2023
1 parent a54c55c commit d19efd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/getOnlyEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const CleanAfterDefaultDomain = ['.br', '.io', '.pt', '.us', '.org', '.com'];
*
* @returns {string | string[]} An email string if multiple is false, or an array of email strings if multiple is true.
*/
function getOnlyEmail(text: string, multiple = false, cleanDomain = false, repeatEmail = false) {
function getOnlyEmail(text: string, multiple = false, cleanDomain: boolean|string[] = false, repeatEmail = false) {

const emailPattern = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g;

Expand Down
5 changes: 5 additions & 0 deletions tester.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-var-requires */

// OBS

// getOnlyEmail resolver 'awiudwaidu@awduiawid.comASDASDduiawid.com',

const {
cpfIsValid,
cnpjIsValid,
Expand Down

0 comments on commit d19efd2

Please sign in to comment.