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

sheet-router

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sheet-router - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

19

href.js
const window = require('global/window')
const assert = require('assert')
module.exports = history
module.exports = href

@@ -10,11 +10,18 @@ // handle a click if is anchor tag with an href

// fn(str) -> null
function history (cb) {
function href (cb) {
assert.equal(typeof cb, 'function', 'cb must be a function')
window.onclick = function (e) {
if (e.target.localName !== 'a') return
if (e.target.href === undefined) return
if (window.location.host !== e.target.host) return
const href = e.target.href.replace(/#$/, '')
const node = (function traverse (node) {
if (!node) return
if (node.localName !== 'a') return traverse(node.parentNode)
if (node.href === undefined) return traverse(node.parentNode)
if (window.location.host !== node.host) return traverse(node.parentNode)
return node
})(e.target)
if (!node) return
e.preventDefault()
const href = node.href.replace(/#$/, '')
cb(href)

@@ -21,0 +28,0 @@ window.history.pushState({}, null, href)

{
"name": "sheet-router",
"version": "2.0.4",
"version": "2.0.5",
"description": "Fast, modular client router",

@@ -5,0 +5,0 @@ "main": "index.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