Socket
Socket
Sign inDemoInstall

router

Package Overview
Dependencies
Maintainers
2
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

router - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

19

formatter.js

@@ -1,7 +0,10 @@

var Param = function(item) {
this.item = item;
var param = function(val) {
return function(map) {
return map[val];
};
};
Param.prototype.toString = function(params) {
return params[this.item];
var str = function(val) {
return function() {
return val;
};
};

@@ -14,10 +17,10 @@

format = format.match(/(?:[^\{]+)|(?:{[^\}]+\})/g).map(function(item) {
return item[0] !== '{' ? item : new Param(item.substring(1, item.length-1));
return item[0] !== '{' ? str(item) : param(item.substring(1, item.length-1));
});
return function(params) {
return format.reduce(function(item, result) {
return result+item.toString(params);
return format.reduce(function(result, item) {
return result+item(params);
}, '');
};
};
{
"name":"router",
"version":"0.6.0",
"version":"0.6.1",
"description":"A lean and mean http router",

@@ -5,0 +5,0 @@ "keywords":["connect","middleware","router","route","http"],

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