Socket
Socket
Sign inDemoInstall

express-jsonp2

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-jsonp2 - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

10

index.js

@@ -53,9 +53,9 @@

// call parent
if (this.req.method !== 'GET') {
callback = 'parent.' + callback;
}
if (callback && 'string' === typeof callback) {
var cb = callback.replace(/[^\[\]\w$.]/g, '');
if (this.req.method !== 'GET') {
cb = 'parent.' + cb;
}
body = 'typeof ' + cb + ' === \'function\' && ' + cb + '(' + body + ');';

@@ -62,0 +62,0 @@

{
"name": "express-jsonp2",
"version": "0.0.1",
"version": "0.0.2",
"description": "express-jsonp2",

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

@@ -57,2 +57,14 @@

it('should return json in absence of callback', function (done) {
request(bootstrap())
.post('/')
.expect(200)
.end(function (err, res) {
res.text.should.equal('{"name":"thom"}');
done();
});
});
it('should wrap in callback if provided', function (done) {

@@ -59,0 +71,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc