Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extract-email-address

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract-email-address - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

8

dist/normalizeInput.js

@@ -8,4 +8,10 @@ "use strict";

var _emojiRegex = _interopRequireDefault(require("emoji-regex"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const emojiRegex = (0, _emojiRegex.default)();
var _default = input => {
return input.replace(/(?<=\s|^)([a-z0-9.-_@])\s?(?=[a-z0-9.-_@](?:\s|$))/g, '$1').replace(/\s+at\s+/g, '@').replace(/\s+dot\s+/g, '.').replace(/\s*<at>\s*/g, '@').replace(/\s*<dot>\s*/g, '.').replace(/\s*\(at\)\s*/g, '@').replace(/\s*\(dot\)\s*/g, '.').replace(/\s*\[at\]\s*/g, '@').replace(/\s*\[dot\]\s*/g, '.');
return input.replace(emojiRegex, ' ').replace(/(?<=\s|^)([a-z0-9.-_@])\s?(?=[a-z0-9.-_@](?:\s|$))/g, '$1').replace(/\s+at\s+/g, '@').replace(/\s+dot\s+/g, '.').replace(/\s*<at>\s*/g, '@').replace(/\s*<dot>\s*/g, '.').replace(/\s*\(at\)\s*/g, '@').replace(/\s*\(dot\)\s*/g, '.').replace(/\s*\[at\]\s*/g, '@').replace(/\s*\[dot\]\s*/g, '.').trim();
};

@@ -12,0 +18,0 @@

3

package.json

@@ -21,2 +21,3 @@ {

"dependencies": {
"emoji-regex": "^9.0.0",
"tlds": "^1.207.0"

@@ -87,3 +88,3 @@ },

},
"version": "1.1.0"
"version": "1.2.0"
}

@@ -23,2 +23,3 @@ <a name="extract-email-address"></a>

```js
import extractEmail from 'extract-email-address';
import type {

@@ -28,2 +29,4 @@ EmailMatchType,

extractEmail(input: string): $ReadOnlyArray<EmailMatchType>;
```

@@ -49,2 +52,5 @@

extractEmail('extracts emails surrounded by emojis, e.g. 📧gajus@gajus.com');
// [{email: 'gajus@gajus.com'}]
extractEmail('excludes invalid emails with invalid TLDs, e.g. gajus@gajus.png');

@@ -51,0 +57,0 @@ // []

// @flow
import createEmojiRegex from 'emoji-regex';
const emojiRegex = createEmojiRegex();
export default (input: string): string => {
return input
.replace(emojiRegex, ' ')
.replace(/(?<=\s|^)([a-z0-9.-_@])\s?(?=[a-z0-9.-_@](?:\s|$))/g, '$1')

@@ -13,3 +18,4 @@ .replace(/\s+at\s+/g, '@')

.replace(/\s*\[at\]\s*/g, '@')
.replace(/\s*\[dot\]\s*/g, '.');
.replace(/\s*\[dot\]\s*/g, '.')
.trim();
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc