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.5 to 1.0.6

4

local-links.js

@@ -79,3 +79,5 @@ function isHTMLElement(obj) {

// then ignore it because we werent looking for hash links
return inPageHash ? null : aPathname;
return inPageHash ?
null :
aPathname + (anchor.search || '') + (aHash || '');
}

@@ -82,0 +84,0 @@ }

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

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

@@ -21,2 +21,3 @@ var test = require('tape');

'<a id="local2" href="/local/page/1">Local2</a>',
'<a id="local-search" href="/local/page/1?param=2">Search</a>',
'<a id="relative" href="page-2">Relative</a>',

@@ -27,2 +28,3 @@ '<a id="global" href="http://google.com/page/number/1">Global</a>',

'<a id="in-page-hash" href="#modal">Hash</a>',
'<a id="out-of-page-hash" href="/local/page/1#two">Out of Page hash</a>',
'<a id="global-hash" href="http://google.com/#hash">Global Hash</a>',

@@ -64,2 +66,4 @@ '<a id="active" href="/">Active</a>',

var a = $('local');
var search = $('local-search');
var outHash = $('out-of-page-hash');
var span = $('local-nested');

@@ -70,6 +74,8 @@ var global = $('global');

t.plan(5);
t.plan(7);
t.equal(localLinks.pathname(a), '/local/page/1');
t.equal(localLinks.pathname(span), '/local/page/1');
t.equal(localLinks.pathname(search), '/local/page/1?param=2');
t.equal(localLinks.pathname(outHash), '/local/page/1#two');
t.equal(localLinks.pathname(global), null);

@@ -76,0 +82,0 @@ t.equal(localLinks.pathname(relative), '/page-2');

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