New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mixdown-router

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mixdown-router - npm Package Compare versions

Comparing version 4.0.5 to 4.1.0

17

lib/parse_params.js
var _ = require('lodash');
var regexSplit = /(\?|\/)([^\?^\/]+)/g;
module.exports = function(s, params) {
module.exports = function (s, params) {
s = s || '';

@@ -10,2 +10,5 @@

// this is here so that we can detect when a literal router is being used so we can match a url with or without a trailing slash.
var bHasParsableRestParams = false;
if (!restParams || restParams.length === 0) {

@@ -16,4 +19,4 @@ restParams = [s];

// replace named params with corresponding regexs and build paramMap.
_.each(restParams, function(str, i) {
var param = _.find(params, function(p, name) {
_.each(restParams, function (str, i) {
var param = _.find(params, function (p, name) {
return str.substring(1) === ':' + name;

@@ -23,2 +26,5 @@ });

if (param) {
bHasParsableRestParams = true; // we found a parseable param
var rstr = param.regex.toString();

@@ -36,2 +42,7 @@ var optChar = (str[0] === '?' ? '?' : '');

// push optional trailing slash to the regex.
if (!bHasParsableRestParams) {
urlformat.push('\\/?');
}
return {

@@ -38,0 +49,0 @@ urlformat: new RegExp('^' + urlformat.join('') + '$'),

2

package.json
{
"name": "mixdown-router",
"version": "4.0.5",
"version": "4.1.0",
"description": "Router for mixdown.js",

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

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