Socket
Socket
Sign inDemoInstall

director

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

director - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

lib/director/browser.js

@@ -115,3 +115,3 @@

// Mozilla always adds an entry to the history
if (mode === 'legacy') {
if (this.mode === 'legacy') {
this.writeFrame(s);

@@ -118,0 +118,0 @@ }

@@ -201,3 +201,3 @@ /*

if (path.source) {
path = path.source;
path = path.source.replace(/\\\//ig, '/');
}

@@ -225,3 +225,3 @@

if (path.source) {
path = path.source;
path = path.source.replace(/\\\//ig, '/');
}

@@ -228,0 +228,0 @@

@@ -5,3 +5,3 @@ {

"author": "Nodejitsu Inc <info@nodejitsu.com>",
"version": "1.0.4",
"version": "1.0.5",
"maintainers": [ "hij1nx <hij1nx@me.com>", "indexzero <charlie.robbins@gmail.com>" ],

@@ -23,6 +23,7 @@ "contributors": [

"codesurgeon": "0.2.x",
"colors": "0.5.x",
"eyes": "0.1.x",
"uglify-js": "1.0.6",
"vows": "0.5.x",
"colors": "0.5.x"
"request": "2.0.x",
"vows": "0.5.x"
},

@@ -29,0 +30,0 @@ "ender": "./build/ender.js",

@@ -617,1 +617,17 @@

});
createTest('setRoute with a single parameter should change location correctly', {
'/bonk': {
on: function() {
shared.fired.push(window.location.hash);
}
}
}, function() {
var self = this;
shared.fired = [];
this.router.setRoute('/bonk');
setTimeout(function() {
deepEqual(shared.fired, ['#/bonk']);
self.finish();
}, 14)
});

@@ -12,9 +12,34 @@ /*

vows = require('vows'),
request = require('request'),
director = require('../../../lib/director');
function helloWorld(route) {
function helloWorld(id) {
this.res.writeHead(200, { 'Content-Type': 'text/plain' })
this.res.end('hello world from (' + route + ')');
}
this.res.end('hello from (' + id + ')');
}
function createServer (router) {
return http.createServer(function (req, res) {
router.dispatch(req, res, function (err) {
if (err) {
res.writeHead(404);
res.end();
}
});
});
}
function assertGet (uri) {
return {
topic: function () {
request({ uri: 'http://localhost:9090/' + uri }, this.callback);
},
"should respond with `hello from (bark)`": function (err, res, body) {
assert.isNull(err);
assert.equal(res.statusCode, 200);
assert.equal(body, 'hello from (bark)')
}
}
}
vows.describe('director/server/http').addBatch({

@@ -31,2 +56,17 @@ "An instance of director.http.Router": {

assert.isFunction(router.routes.hello.get);
},
"when passed to an http.Server instance": {
topic: function (router) {
router.get(/foo\/bar\/(\w+)/, helloWorld);
router.path(/bar\/bazz\//, function () {
this.get(/(\w+)/, helloWorld)
});
var server = createServer(router),
that = this;
server.listen(9090, this.callback);
},
"a request to foo/bar/bark": assertGet('foo/bar/bark'),
"a request to bar/bazz/bark": assertGet('bar/bazz/bark')
}

@@ -33,0 +73,0 @@ }

Sorry, the diff of this file is not supported yet

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