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

react-anchorme

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-anchorme - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

2

dist/react-anchorme.esm.js

@@ -1,1 +0,1 @@

import t,{useCallback as r,useMemo as n}from"react";import e from"anchorme";var o=function(){return o=Object.assign||function(t){for(var r,n=1,e=arguments.length;n<e;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},o.apply(this,arguments)};function i(t,r){var n={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.indexOf(e)<0&&(n[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(e=Object.getOwnPropertySymbols(t);o<e.length;o++)r.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(t,e[o])&&(n[e[o]]=t[e[o]])}return n}var a=/^((file:\/\/\/)|(https?:|ftps?:)\/\/|(mailto:))/i,c=function(t){return function(t){return a.test(t)}(t)?"":e.validate.email(t)?"mailto:":"http://"},u=function(r){var n=r.href,e=r.linkComponent,a=r.truncate,u=i(r,["href","linkComponent","truncate"]),l=null!=e?e:"a",f=c(n),p=a?function(t,r){if("production"!==process.env.NODE_ENV&&r<=0)throw new Error("⚓️ maxLength should be positive number");return t.length>r?t.substring(0,r)+"…":t}(n,a):n;return t.createElement(l,o({},u,{href:"".concat(f).concat(n)}),p)},l=t.memo((function(a){var c=a.children,l=i(a,["children"]),f=c,p=r((function(){var r=e.list(f);if(0===r.length)return f;var n=[],i=0;return r.forEach((function(r,e){r.start>i&&n.push(f.substring(i,r.start)),n.push(t.createElement(u,o({},l,{key:e,href:r.string}))),i=r.end})),f.length>i&&n.push(f.substring(i)),1===n.length?n[0]:n}),[f,l]),s=n((function(){return p()}),[p]);return t.createElement(t.Fragment,null,s)}));export{l as Anchorme};
import t,{useCallback as r,useMemo as e}from"react";import n from"anchorme";var o=function(){return o=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},o.apply(this,arguments)};function i(t,r){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.indexOf(n)<0&&(e[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(e[n[o]]=t[n[o]])}return e}"function"==typeof SuppressedError&&SuppressedError;var u=/^((file:\/\/\/)|(https?:|ftps?:)\/\/|(mailto:))/i,a=function(t){return function(t){return u.test(t)}(t)?"":n.validate.email(t)?"mailto:":"http://"},c=function(r){var e=r.href,n=r.linkComponent,u=r.truncate,c=i(r,["href","linkComponent","truncate"]),l=null!=n?n:"a",p=a(e),f=u?function(t,r){if("production"!==process.env.NODE_ENV&&r<=0)throw new Error("⚓️ maxLength should be positive number");return t.length>r?t.substring(0,r)+"…":t}(e,u):e;return t.createElement(l,o({},c,{href:"".concat(p).concat(e)}),f)},l=t.memo((function(u){var a=u.children,l=i(u,["children"]),p=a,f=r((function(){var r=n.list(p);if(0===r.length)return p;var e=[],i=0;return r.forEach((function(r,n){r.start>i&&e.push(p.substring(i,r.start)),e.push(t.createElement(c,o({},l,{key:n,href:r.string}))),i=r.end})),p.length>i&&e.push(p.substring(i)),1===e.length?e[0]:e}),[p,l]),s=e((function(){return f()}),[f]);return t.createElement(t.Fragment,null,s)}));export{l as Anchorme};

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("anchorme");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=r(t),o=r(e),u=function(){return u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},u.apply(this,arguments)};function a(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}var l=/^((file:\/\/\/)|(https?:|ftps?:)\/\/|(mailto:))/i,i=function(t){return function(t){return l.test(t)}(t)?"":o.default.validate.email(t)?"mailto:":"http://"},c=function(t){var e=t.href,r=t.linkComponent,o=t.truncate,l=a(t,["href","linkComponent","truncate"]),c=null!=r?r:"a",f=i(e),s=o?function(t,e){if("production"!==process.env.NODE_ENV&&e<=0)throw new Error("⚓️ maxLength should be positive number");return t.length>e?t.substring(0,e)+"…":t}(e,o):e;return n.default.createElement(c,u({},l,{href:"".concat(f).concat(e)}),s)},f=n.default.memo((function(e){var r=e.children,l=a(e,["children"]),i=r,f=t.useCallback((function(){var t=o.default.list(i);if(0===t.length)return i;var e=[],r=0;return t.forEach((function(t,o){t.start>r&&e.push(i.substring(r,t.start)),e.push(n.default.createElement(c,u({},l,{key:o,href:t.string}))),r=t.end})),i.length>r&&e.push(i.substring(r)),1===e.length?e[0]:e}),[i,l]),s=t.useMemo((function(){return f()}),[f]);return n.default.createElement(n.default.Fragment,null,s)}));exports.Anchorme=f;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("anchorme");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e),o=r(t),u=function(){return u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},u.apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}"function"==typeof SuppressedError&&SuppressedError;var l=/^((file:\/\/\/)|(https?:|ftps?:)\/\/|(mailto:))/i,i=function(e){return function(e){return l.test(e)}(e)?"":o.default.validate.email(e)?"mailto:":"http://"},c=function(e){var t=e.href,r=e.linkComponent,o=e.truncate,l=a(e,["href","linkComponent","truncate"]),c=null!=r?r:"a",f=i(t),s=o?function(e,t){if("production"!==process.env.NODE_ENV&&t<=0)throw new Error("⚓️ maxLength should be positive number");return e.length>t?e.substring(0,t)+"…":e}(t,o):t;return n.default.createElement(c,u({},l,{href:"".concat(f).concat(t)}),s)},f=n.default.memo((function(t){var r=t.children,l=a(t,["children"]),i=r,f=e.useCallback((function(){var e=o.default.list(i);if(0===e.length)return i;var t=[],r=0;return e.forEach((function(e,o){e.start>r&&t.push(i.substring(r,e.start)),t.push(n.default.createElement(c,u({},l,{key:o,href:e.string}))),r=e.end})),i.length>r&&t.push(i.substring(r)),1===t.length?t[0]:t}),[i,l]),s=e.useMemo((function(){return f()}),[f]);return n.default.createElement(n.default.Fragment,null,s)}));exports.Anchorme=f;
{
"name": "react-anchorme",
"version": "3.0.0",
"version": "4.0.0",
"description": "React component to detect links in text and make them clickable",

@@ -31,3 +31,3 @@ "repository": "https://github.com/potty/react-anchorme",

"dependencies": {
"anchorme": "^2.1.2"
"anchorme": "^3.0.5"
},

@@ -34,0 +34,0 @@ "peerDependencies": {

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