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

local-links

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

local-links - npm Package Compare versions

Comparing version 1.0.10 to 1.1.0

5

local-links.js

@@ -45,2 +45,7 @@ function isHTMLElement(obj) {

// Dont test anchors with target=_blank
if (anchor.target === '_blank') {
return null;
}
// IE9 doesn't put a leading slash on anchor.pathname [1]

@@ -47,0 +52,0 @@ var aPathname = normalizeLeadingSlash(anchor.pathname);

2

package.json
{
"name": "local-links",
"description": "Determine cross-browser if an event or anchor element should be handled locally.",
"version": "1.0.10",
"version": "1.1.0",
"author": "Luke Karrys <luke@lukekarrys.com>",

@@ -6,0 +6,0 @@ "bugs": {

@@ -101,2 +101,8 @@ local-links

#### `target="_blank"`
If the anchor has target="_blank" it will return `null` for both the `pathname()` and
`hash()` methods.
#### Hash links

@@ -103,0 +109,0 @@

@@ -31,2 +31,4 @@ var test = require('tape');

'<span id="no-anchor">No anchor</span>',
'<a id="local-blank" href="/local/page/1" target="_blank">Local Blank</a>',
'<a id="local-blank-hash" href="#modal2" target="_blank">Local Blank Hash</a>',
].join('');

@@ -71,4 +73,5 @@ document.body.appendChild(container);

var noAnchor = $('no-anchor');
var localBlank = $('local-blank');
t.plan(7);
t.plan(8);

@@ -82,2 +85,3 @@ t.equal(localLinks.pathname(a), '/local/page/1');

t.equal(localLinks.pathname(noAnchor), null);
t.equal(localLinks.pathname(localBlank), null);

@@ -130,10 +134,13 @@ t.end();

var globalHash = $('global-hash');
var targetBlankHash = $('local-blank-hash');
t.plan(5);
t.plan(7);
t.equal(localLinks.pathname(hash), null);
t.equal(localLinks.pathname(emptyHash), null);
t.equal(localLinks.pathname(targetBlankHash), null);
t.equal(localLinks.hash(hash), '#modal');
t.equal(localLinks.hash(emptyHash), '#');
t.equal(localLinks.hash(targetBlankHash), null);

@@ -140,0 +147,0 @@ t.equal(localLinks.hash(globalHash), null);

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