hash-brown-router
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -22,5 +22,10 @@ var EventEmitter = require('events').EventEmitter | ||
function replace(window, newPath) { | ||
window.location.replace(window.location.origin + window.location.pathname + '#' + newPath) | ||
window.location.replace(everythingBeforeTheSlash(window.location.href) + '#' + newPath) | ||
} | ||
function everythingBeforeTheSlash(url) { | ||
var hashIndex = url.indexOf('#') | ||
return hashIndex === -1 ? url : url.substring(0, hashIndex) | ||
} | ||
function go(window, newPath) { | ||
@@ -27,0 +32,0 @@ window.location.hash = newPath |
{ | ||
"name": "hash-brown-router", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "A client-side router that only cares about the bits after the #", | ||
@@ -8,3 +8,4 @@ "main": "index.js", | ||
"test": "node test/automated-test.js", | ||
"browserwatch": "watchify test/browser-test.js -o test/build.js -d" | ||
"browserwatch": "watchify test/browser-test.js -o test/build.js -d", | ||
"browsertest": "browserify test/browser-test.js -o browser-test.js -d" | ||
}, | ||
@@ -29,2 +30,3 @@ "repository": { | ||
"devDependencies": { | ||
"browserify": "^11.0.0", | ||
"domready": "^1.0.8", | ||
@@ -31,0 +33,0 @@ "tap-browser-color": "^0.1.2", |
@@ -11,3 +11,3 @@ var router = require('../') | ||
var route = getRoute() | ||
t.timeoutAfter(300) | ||
t.timeoutAfter(2000) | ||
@@ -32,3 +32,3 @@ route.add('/non-butts', function() { | ||
route.stop() | ||
}, 200) | ||
}, 500) | ||
}) | ||
@@ -39,3 +39,3 @@ | ||
t.timeoutAfter(300) | ||
t.timeoutAfter(2000) | ||
@@ -58,3 +58,3 @@ var fail = t.fail.bind(t, 'the wrong route was called') | ||
route.stop() | ||
}, 200) | ||
}, 500) | ||
}) | ||
@@ -88,3 +88,3 @@ | ||
t.end() | ||
}, 200) | ||
}, 500) | ||
}) | ||
@@ -95,3 +95,3 @@ | ||
t.timeoutAfter(300) | ||
t.timeoutAfter(2000) | ||
@@ -112,3 +112,3 @@ route.add('/no/way', t.fail.bind(t, 'the wrong route was called')) | ||
route.stop() | ||
}, 200) | ||
}, 500) | ||
}) | ||
@@ -119,3 +119,3 @@ | ||
t.timeoutAfter(300) | ||
t.timeoutAfter(2000) | ||
@@ -135,3 +135,3 @@ route.add('/default', function() { | ||
route.stop() | ||
}, 200) | ||
}, 500) | ||
}) | ||
@@ -142,3 +142,3 @@ | ||
t.timeoutAfter(400) | ||
t.timeoutAfter(2000) | ||
@@ -159,3 +159,3 @@ locationHash.go('/starting-path') | ||
route.stop() | ||
}, 200) | ||
}, 500) | ||
@@ -168,3 +168,3 @@ }, 100) | ||
var route = getRoute() | ||
t.timeoutAfter(300) | ||
t.timeoutAfter(2000) | ||
@@ -185,3 +185,3 @@ route.add('myroute/:fromUrl', function(parameters) { | ||
route.stop() | ||
}, 200) | ||
}, 500) | ||
}) | ||
@@ -192,3 +192,3 @@ | ||
t.timeoutAfter(300) | ||
t.timeoutAfter(2000) | ||
@@ -207,3 +207,3 @@ route.add('myroute/:fromUrl', function(parameters) { | ||
route.stop() | ||
}, 200) | ||
}, 500) | ||
}) | ||
@@ -214,3 +214,3 @@ | ||
t.timeoutAfter(300) | ||
t.timeoutAfter(2000) | ||
@@ -230,3 +230,3 @@ route.setDefault(function(path, parameters) { | ||
route.stop() | ||
}, 200) | ||
}, 500) | ||
}) | ||
@@ -274,3 +274,3 @@ | ||
t.timeoutAfter(500) | ||
t.timeoutAfter(2000) | ||
@@ -296,3 +296,3 @@ route.add('/route/:oneThing', function() { | ||
t.timeoutAfter(500) | ||
t.timeoutAfter(2000) | ||
@@ -299,0 +299,0 @@ route.add('/route/:oneThing', function() { |
var allTests = require('./all-tests') | ||
var tapBrowserColor = require('tap-browser-color') | ||
// var tapBrowserColor = require('tap-browser-color') | ||
var browserHashLocation = require('../hash-location.js') | ||
@@ -9,2 +9,2 @@ | ||
tapBrowserColor() | ||
// tapBrowserColor() |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
514983
14
7407
4
7
1