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

can-route

Package Overview
Dependencies
Maintainers
13
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 4.3.11 to 4.3.12

2

package.json
{
"name": "can-route",
"version": "4.3.11",
"version": "4.3.12",
"description": "Observable front-end application routing for CanJS.",

@@ -5,0 +5,0 @@ "homepage": "https://canjs.com/doc/can-route.html",

@@ -83,32 +83,37 @@ var canRoute = require('can-route');

setupRouteTest(function (iframe, iCanRoute, loc) {
iCanRoute.start();
iCanRoute.register("{type}");
iCanRoute.register("{type}/{id}");
iCanRoute.attr({
type: "bar"
});
setTimeout(function () {
var after = loc.href.substr(loc.href.indexOf("#"));
equal(after, "#!bar");
iCanRoute._onStartComplete = function () {
iCanRoute.attr({
type: "bar",
id: "\/"
type: "bar"
});
// check for 1 second
var time = new Date();
setTimeout(function innerTimer() {
setTimeout(function () {
var after = loc.href.substr(loc.href.indexOf("#"));
var isMatch = after === "#!bar/" + encodeURIComponent("\/");
var isWaitingTooLong = new Date() - time > 2000;
if (isMatch || isWaitingTooLong) {
equal(after, "#!bar/" + encodeURIComponent("\/"), "should go to type/id "+ (new Date() - time));
teardownRouteTest();
} else {
setTimeout(innerTimer, 30);
}
}, 100);
}, 100);
equal(after, "#!bar");
iCanRoute.attr({
type: "bar",
id: "\/"
});
// check for 1 second
var time = new Date();
setTimeout(function innerTimer() {
var after = loc.href.substr(loc.href.indexOf("#"));
var isMatch = after === "#!bar/" + encodeURIComponent("\/");
var isWaitingTooLong = new Date() - time > 5000;
if (isMatch || isWaitingTooLong) {
equal(after, "#!bar/" + encodeURIComponent("\/"), "should go to type/id "+ (new Date() - time));
teardownRouteTest();
} else {
setTimeout(innerTimer, 30);
}
}, 30);
}, 150);
};
iCanRoute.start();
});

@@ -115,0 +120,0 @@ });

@@ -192,42 +192,2 @@ /* jshint asi:true */

test("unsticky routes", function () {
setupRouteTest(function (iframe, iCanRoute, loc) {
iCanRoute.start();
iCanRoute.register("{type}");
iCanRoute.register("{type}/{id}");
iCanRoute.attr({
type: "bar"
});
setTimeout(function () {
var after = loc.href.substr(loc.href.indexOf("#"));
equal(after, "#!bar");
iCanRoute.attr({
type: "bar",
id: "\/"
});
// check for 1 second
var time = new Date()
setTimeout(function innerTimer() {
var after = loc.href.substr(loc.href.indexOf("#"));
if (after === "#!bar/" + encodeURIComponent("\/")) {
equal(after, "#!bar/" + encodeURIComponent("\/"), "should go to type/id");
teardownRouteTest();
} else if (new Date() - time > 2000) {
ok(false, "hash is " + after);
can.remove(can.$(iframe))
} else {
setTimeout(innerTimer, 30)
}
}, 100);
}, 100);
});
});
test("updating bound SimpleMap causes single update with a coerced string value", function() {

@@ -234,0 +194,0 @@ expect(1);

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