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

can-route

Package Overview
Dependencies
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-route - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

package.json
{
"name": "can-route",
"version": "0.2.0",
"version": "0.2.1",
"description": "A simple regexp router that runs inside a `http.createServer` handler and returns false when it can’t route a request.",

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

@@ -25,6 +25,7 @@ var named = require('named-regexp').named

Can.prototype.route = function(req, res) {
var hash = !server && res === true
var pathname = (typeof req == 'string' ?
req : null
(!hash ? req.replace(/(\?|#).+$/, '') : req ) :
null
)
var method = (server ?

@@ -34,4 +35,2 @@ req.method.toLowerCase() : 'get'

var hash = !server && res === true
if (!pathname) {

@@ -38,0 +37,0 @@ var href = req.url || req.href

@@ -29,5 +29,5 @@ var run = require('tape').test

window.onhashchange = function() {
window.onhashchange = null
test.ok(can.route(location, true), 'can route')
test.deepEqual(result, expected)
window.onhashchange = null
test.end()

@@ -44,5 +44,5 @@ }

window.onhashchange = function() {
window.onhashchange = null
test.ok(can.route(location, true), 'can route')
test.deepEqual(result, expected)
window.onhashchange = null
test.end()

@@ -60,5 +60,5 @@ }

window.onhashchange = function() {
window.onhashchange = null
test.ok(can.route(location, true), 'can route')
test.deepEqual(result, expected)
window.onhashchange = null
test.end()

@@ -74,2 +74,3 @@ }

window.onhashchange = function() {
window.onhashchange = null
test.ok(!can.route(location), 'indeed')

@@ -76,0 +77,0 @@ test.end()

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