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.3 to 2.0.4

9

href.js

@@ -7,6 +7,8 @@ const window = require('global/window')

// handle a click if is anchor tag with an href
// and url lives on the same domain
// and url lives on the same domain. Replaces
// trailing '#' so empty links work as expected.
// fn(str) -> null
function history (cb) {
assert.equal(typeof cb, 'function', 'cb must be a function')
window.onclick = function (e) {

@@ -16,6 +18,7 @@ if (e.target.localName !== 'a') return

if (window.location.host !== e.target.host) return
const href = e.target.href.replace(/#$/, '')
e.preventDefault()
cb(e.target.href)
window.history.pushState({}, null, e.target.href)
cb(href)
window.history.pushState({}, null, href)
}
}
{
"name": "sheet-router",
"version": "2.0.3",
"version": "2.0.4",
"description": "Fast, modular client router",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -114,2 +114,4 @@ # sheet-router [![stability][0]][1]

```
It is good practice to represent JS actions as `<a href="#">`, as a good
number of components in the wild expect `<a>` tags to have an `href` value.

@@ -116,0 +118,0 @@ ### virtual-dom example

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