New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@iamcal/autolink-js

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iamcal/autolink-js - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

lib/autolink.min.js

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

/*! autolink-js 2018-10-02 */
"use strict";(function(){var a=this,b=a.AutoLink,c=function(){var a=this;return a.stripProtocols=!0,a.tagFill="",a.autoTitle=!0,a.maxLength=30,a},d=function(a,b,c,d,e,k,l){for(var m=a.toLowerCase(),n=0,o=!0,p="",q=!0,r=0,s="",t="",u="",v="",w="",x=0;n<a.length&&o;){q=!0,b.lastIndex=n;var y=b.exec(m);if(y){var z=y.index,r=y[0].length;s=a.substr(n,z-n),t=a.substr(z,r),u=a.substr(0,z),v=a.substr(z+r),w=s+t,x=w.length;var A=u.split(/<\/a>/i),B=A.pop();B.match(/<a\s/i)&&(g("fail 1 at "+n),q=!1,n+=x,p+=w)}else o=!1,q=!1;if(q&&u.length&&(u.match(/[\s\(\[\{>]$/)||(g("fail 2 at "+n+" ("+u+")"),q=!1,n+=x,p+=w)),q){var C=/^([a-z0-9\-\.\/\-_%~!?=,:;&+*#@\(\)\$]+)/i,D=C.exec(v);if(D){var E=t+D[1];for(n+=E.length+s.length,p+=s,E=h(E);E.match(/[.,!;:?]$/);)E=E.substr(0,E.length-1),n--;E.match(/^(\)|^)[^\(]+\)$/)&&(E=E.substr(0,E.length-1),n--),E.match(/^(\]|^)[^\[]+\]$/)&&(E=E.substr(0,E.length-1),n--),E.match(/^(\}|^)[^\{]+\}$/)&&(E=E.substr(0,E.length-1),n--);var F=E,G=E;if(c&&(F=c+F),l){var H=new RegExp("^(http|https)://","i"),I=H.exec(G);I&&(G=G.substr(I[1].length+3))}G=j(G,d);var J=e;G!=F&&!J.match(/title=/i)&&k&&(F.match(new RegExp("https?://"+f(G),"i"))||(J+=' title="'+F+'"'));var K=i(F),L=i(G);p+='<a href="'+K+'"'+J+">"+L+"</a>"}else g("fail 3 at "+n),q=!1,n+=x,p+=w}}return p+=a.substr(n)},e=function(a,b){for(var c='[^()<>@,;:\\\\".\\[\\]\\x00-\\x20\\x7f]+',d="("+c+"(\\."+c+")*)",e=new RegExp("^"+d),f=new RegExp(d+"$"),g=a.toLowerCase(),h=0,i=!0,j="",k="",l="",m="",n="",o=0;h<a.length&&i;){var p=!0,q=g.indexOf("@",h);if(q===-1)i=!1,p=!1;else{k=a.substr(h,q-h),l=a.substr(q,1),m=a.substr(q+1),n=k+l,o=n.length;var r=k.split(/<\/a>/i),s=r.pop();s.match(/<a\s/i)&&(p=!1,h+=o,j+=n)}if(p){var t=k.match(f);if(t){var u=t[1].length,v=k.length;l=k.substr(v-u)+l,k=k.substr(0,v-u)}else p=!1,h+=o,j+=n}if(p){var t=m.match(e);if(t){var u=t[1].length;l+=m.substr(0,u),m=m.substr(u)}else p=!1,h+=o,j+=n}p&&(h+=k.length+l.length,j+=k,j+='<a href="mailto:'+l+'"'+b+">"+l+"</a>")}return j+=a.substr(h)},f=function(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},g=function(a){},h=function(a){return a.replace(/&(quot|gt|lt|amp|\#([0-9]+)|\#x([0-9a-f]+));/gi,function(a,b,c,d){return"quot"==b.toLowerCase()?'"':"gt"==b.toLowerCase()?">":"lt"==b.toLowerCase()?"<":"amp"==b.toLowerCase()?"&":c?String.fromCharCode(parseInt(c)):d?String.fromCharCode(parseInt(d,16)):void 0})},i=function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},j=function(a,b){return b&&a.length>b?a.substr(0,b-3)+"...":a};c.prototype.link=function(a){return a=d(a,new RegExp("[a-z][a-z-]+://","ig"),null,this.maxLength,this.tagFill,this.autoTitle,this.stripProtocols),a=d(a,new RegExp("(mailto|skype):","ig"),null,this.maxLength,this.tagFill,this.autoTitle,this.stripProtocols),a=d(a,new RegExp("www\\.","ig"),"http://",this.maxLength,this.tagFill,this.autoTitle,this.stripProtocols)},c.prototype.linkEmail=function(a){return a=e(a,this.tagFill)},c.prototype.noConflict=function(){return a.AutoLink=b,c},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=c),exports.AutoLink=c):"function"==typeof define&&define.amd?define(function(){return c}):a.AutoLink=c}).call(function(){return this||("undefined"!=typeof window?window:global)}());
/* @iamcal/autolink-js 2021-05-07 */
"use strict";!function(){function t(){var t=this;return t.stripProtocols=!0,t.tagFill="",t.autoTitle=!0,t.maxLength=30,t}function e(t,e,n,r,i,s,o){for(var a=t.toLowerCase(),l=0,u=!0,h="",g=!0,p=0,c="",f="",m="",x="",d="",b=0;l<t.length&&u;){g=!0,e.lastIndex=l;var w=e.exec(a);if(w?(C=w.index,p=w[0].length,c=t.substr(l,C-l),f=t.substr(C,p),m=t.substr(0,C),x=t.substr(C+p),b=(d=c+f).length,m.split(/<\/a>/i).pop().match(/<a\s/i)&&(y("fail 1 at "+l),g=!1,l+=b,h+=d)):g=u=!1,g&&m.length&&(m.match(/[\s\(\[\{>]$/)||(y("fail 2 at "+l+" ("+m+")"),g=!1,l+=b,h+=d)),g){w=/^([a-z0-9\-\.\/\-_%~!?=,:;&+*#@\(\)\$]+)/i.exec(x);if(w){var L=f+w[1];for(l+=L.length+c.length,h+=c,L=E(L);L.match(/[.,!;:?]$/);)L=L.substr(0,L.length-1),l--;L.match(/^(\)|^)[^\(]+\)$/)&&(L=L.substr(0,L.length-1),l--),L.match(/^(\]|^)[^\[]+\]$/)&&(L=L.substr(0,L.length-1),l--),L.match(/^(\}|^)[^\{]+\}$/)&&(L=L.substr(0,L.length-1),l--);var C=L,w=L;n&&(C=n+C),!o||(v=new RegExp("^(http|https)://","i").exec(w))&&(w=w.substr(v[1].length+3));var v=i;(w=R(w,r))!=C&&!v.match(/title=/i)&&s&&(C.match(new RegExp("https?://"+$(w),"i"))||(v+=' title="'+C+'"')),h+='<a href="'+k(C)+'"'+v+">"+k(w)+"</a>"}else y("fail 3 at "+l),g=!1,l+=b,h+=d}}return h+=t.substr(l)}var n=this,r=n.AutoLink,$=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},y=function(t){},E=function(t){return t.replace(/&(quot|gt|lt|amp|\#([0-9]+)|\#x([0-9a-f]+));/gi,function(t,e,n,r){return"quot"==e.toLowerCase()?'"':"gt"==e.toLowerCase()?">":"lt"==e.toLowerCase()?"<":"amp"==e.toLowerCase()?"&":n?String.fromCharCode(parseInt(n)):r?String.fromCharCode(parseInt(r,16)):void 0})},k=function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},R=function(t,e){return e&&t.length>e?t.substr(0,e-3)+"...":t};t.prototype.link=function(t){return t=e(t,new RegExp("[a-z][a-z-]+://","ig"),null,this.maxLength,this.tagFill,this.autoTitle,this.stripProtocols),t=e(t,new RegExp("(mailto|skype):","ig"),null,this.maxLength,this.tagFill,this.autoTitle,this.stripProtocols),t=e(t,new RegExp("www\\.","ig"),"http://",this.maxLength,this.tagFill,this.autoTitle,this.stripProtocols)},t.prototype.linkEmail=function(t){return t=function(t,e){for(var n='[^()<>@,;:\\\\".\\[\\]\\x00-\\x20\\x7f]+',n="("+n+"(\\."+n+")*)",r=new RegExp("^"+n),i=new RegExp(n+"$"),s=t.toLowerCase(),o=0,a=!0,l="",u="",h="",g="",p="",c=0;o<t.length&&a;){var f,m,x=!0,d=s.indexOf("@",o);-1===d?x=a=!1:(u=t.substr(o,d-o),h=t.substr(d,1),g=t.substr(d+1),c=(p=u+h).length,u.split(/<\/a>/i).pop().match(/<a\s/i)&&(x=!1,o+=c,l+=p)),x&&((f=u.match(i))?(m=f[1].length,d=u.length,h=u.substr(d-m)+h,u=u.substr(0,d-m)):(x=!1,o+=c,l+=p)),x&&((f=g.match(r))?(m=f[1].length,h+=g.substr(0,m),g=g.substr(m)):(x=!1,o+=c,l+=p)),x&&(o+=u.length+h.length,l+=u,l+='<a href="mailto:'+h+'"'+e+">"+h+"</a>")}return l+=t.substr(o)}(t,this.tagFill)},t.prototype.noConflict=function(){return n.AutoLink=r,t},"undefined"!=typeof exports?(exports="undefined"!=typeof module&&module.exports?module.exports=t:exports).AutoLink=t:"function"==typeof define&&define.amd?define(function(){return t}):n.AutoLink=t}.call(function(){return this||("undefined"!=typeof window?window:global)}());
{
"name": "@iamcal/autolink-js",
"version": "0.1.0",
"version": "0.1.1",
"description": "JS link formatting library",

@@ -13,14 +13,10 @@ "main": "lib/autolink.js",

"devDependencies": {
"grunt": "~1.0.1",
"grunt-contrib-uglify": "~1.0.1",
"grunt-karma": "~0.12.2",
"grunt-karma-coveralls": "^2.5.3",
"jasmine-core": "~2.4.1",
"karma": "~0.13.22",
"karma-chrome-launcher": "~0.2.0",
"karma-coverage": "~0.5.5",
"karma-jasmine": "~0.3.5",
"karma-phantomjs-launcher": "~1.0.0",
"jasmine-core": "~3.7",
"karma": "~6.3",
"karma-coverage": "~2.0",
"karma-jasmine": "~4.0",
"karma-chrome-launcher": "~3.1.0",
"puppeteer": "~9.1.1",
"karma-story-reporter": "^0.3.1",
"phantomjs-prebuilt": "~2.1.7"
"uglify-js": "^3.13.5"
},

@@ -43,3 +39,9 @@ "repository": {

},
"homepage": "https://github.com/iamcal/autolink-js"
"homepage": "https://github.com/iamcal/autolink-js",
"scripts": {
"uglify": "echo \"/* $(npm -s run env echo '$npm_package_name') $(date +%Y-%m-%d) */\" > lib/autolink.min.js; ./node_modules/.bin/uglifyjs -c -m -- lib/autolink.js >> lib/autolink.min.js",
"test": "./node_modules/.bin/karma start karma.conf.js --single-run --log-level error",
"coverage": "./node_modules/.bin/karma start karma-cover.conf.js --single-run --log-level disable",
"build": "npm run uglify && npm run test && npm run coverage"
}
}
# autolink-js - JS link formatting library
<span class="badge-npmversion"><a href="https://npmjs.org/package/emoji-js" title="View this project on NPM"><img src="https://img.shields.io/npm/v/emoji-js.svg" alt="NPM version" /></a></span>
<span class="badge-npmdownloads"><a href="https://npmjs.org/package/emoji-js" title="View this project on NPM"><img src="https://img.shields.io/npm/dm/emoji-js.svg" alt="NPM downloads" /></a></span>
<span class="badge-npmversion"><a href="https://npmjs.org/package/@iamcal/autolink-js" title="View this project on NPM"><img src="https://img.shields.io/npm/v/@iamcal/autolink-js.svg" alt="NPM version" /></a></span>
<span class="badge-npmdownloads"><a href="https://npmjs.org/package/@iamcal/autolink-js" title="View this project on NPM"><img src="https://img.shields.io/npm/dm/@iamcal/autolink-js.svg" alt="NPM downloads" /></a></span>
[![Build Status](https://github.com/iamcal/autolink-js/actions/workflows/build.yml/badge.svg)](https://github.com/iamcal/autolink-js/actions)

@@ -7,0 +6,0 @@ [![Coverage Status](https://coveralls.io/repos/iamcal/autolink-js/badge.svg)](https://coveralls.io/r/iamcal/autolink-js)

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