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

baobab-router

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baobab-router - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

19

baobab-router.dist.js

@@ -78,3 +78,3 @@ 'use strict';

}).map(function (k) {
return escape(k) + '=' + escape(qry[k]);
return escape(k) + '=' + escape(_typeof(qry[k]) === 'object' && qry[k] ? JSON.stringify(qry[k]) : '' + qry[k]);
}).join('&');

@@ -521,13 +521,20 @@

var query = (route.query || {})[arr[0]] || {};
var value = undefined;
var value = unescape(arr[1]);
switch (query.cast) {
case 'number':
value = +arr[1];
value = +value;
break;
case 'boolean':
value = arr[1] === 'true' ? true : false;
value = value === 'true' ? true : false;
break;
case 'json':
try {
value = value ? JSON.parse(value) : null;
} catch (e) {
value = null;
}
break;
default:
value = arr[1];
// Nothing actually...
}

@@ -758,3 +765,3 @@

// Baobab-Router version:
BaobabRouter.version = '2.1.0';
BaobabRouter.version = '2.2.0';

@@ -761,0 +768,0 @@ // Expose private methods for unit testing:

@@ -71,3 +71,7 @@ /**

.filter(k => qry[k] !== null && qry[k] !== undefined)
.map(k => escape(k) + '=' + escape(qry[k]))
.map(k => escape(k) + '=' + escape(
(typeof qry[k] === 'object' && qry[k]) ?
JSON.stringify(qry[k]) :
('' + qry[k])
))
.join('&');

@@ -559,13 +563,22 @@

const query = (route.query || {})[arr[0]] || {};
let value;
let value = unescape(arr[1]);
switch (query.cast) {
case 'number':
value = +arr[1];
value = +value;
break;
case 'boolean':
value = arr[1] === 'true' ? true : false;
value = value === 'true' ? true : false;
break;
case 'json':
try {
value = value ?
JSON.parse(value) :
null;
} catch (e) {
value = null;
}
break;
default:
value = arr[1];
// Nothing actually...
}

@@ -818,3 +831,3 @@

// Baobab-Router version:
BaobabRouter.version = '2.1.0';
BaobabRouter.version = '2.2.0';

@@ -821,0 +834,0 @@ // Expose private methods for unit testing:

{
"name": "baobab-router",
"version": "2.1.0",
"version": "2.2.0",
"description": "A router for Baobab",

@@ -5,0 +5,0 @@ "main": "baobab-router.dist.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