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

express-query-params

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

express-query-params - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

2

lib/params.js

@@ -47,2 +47,4 @@ 'use strict';

parsed[p][operator] = typeCast(query[p].split(equal ? '<=' : '<').join(''));
} else if (query[p] === 'true' || query[p] === 'false') {
parsed[p] = query[p] === 'true' ? true : false;
} else {

@@ -49,0 +51,0 @@ parsed[p] = query[p];

2

package.json
{
"name": "express-query-params",
"version": "0.1.1",
"version": "0.2.0",
"description": "Express.js middleware implementing the API Query Spec, converting the params to SQL or a Mongo query",

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

@@ -24,4 +24,2 @@ # Mongo Express Query Params

Inside any downstream middleware, this plugin will create a `parsedQuery` object on the `request`. See the [test](https://github.com/mtimofiiv/express-query-params/blob/master/test/test.js) to see how it works.
## Advanced Usage

@@ -28,0 +26,0 @@

@@ -19,3 +19,5 @@ 'use strict';

friends: '>=5',
followers: '<=10'
followers: '<=10',
banned: 'false',
activated: 'true'
}

@@ -121,2 +123,7 @@ };

it('parses booleans properly', function() {
expect(request.parsedQuery.activated).to.equal(true);
expect(request.parsedQuery.banned).to.equal(false);
});
});
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