react-social-icons
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -22,3 +22,3 @@ "use strict"; | ||
exports.KEYS = KEYS; | ||
var KEYS_REGEX = new RegExp('(?:https?:\\/\\/(?:[a-z0-9]*.)?)?(' + KEYS.join('|') + ').*'); | ||
var KEYS_REGEX = /(?:https?:\/\/)?(?:.*\.)?(?<key>.*?)\..*?($|\/)/; | ||
@@ -53,4 +53,10 @@ function keyTo(key, _ref) { | ||
var key = url.replace(KEYS_REGEX, '$1'); | ||
return key === url ? DEFAULT_KEY : key; | ||
if (url.startsWith('mailto:')) { | ||
return 'mailto'; | ||
} | ||
var _url$match = url.match(KEYS_REGEX), | ||
groups = _url$match.groups; | ||
return groups && KEYS.includes(groups.key) ? groups.key : DEFAULT_KEY; | ||
} | ||
@@ -57,0 +63,0 @@ |
{ | ||
"name": "react-social-icons", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "beautiful, easy svg social icons in react", | ||
@@ -5,0 +5,0 @@ "main": "./build/react-social-icons.js", |
Sorry, the diff of this file is too big to display
98359
17
796