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

bequest

Package Overview
Dependencies
Maintainers
5
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bequest - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

test/bequest.test.dist.js

39

dist/ajax.js

@@ -80,16 +80,3 @@ var Bequest = (function () {

var data = args[0],
headers = args[1],
callback = args[2];
var serializedData = data;
if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object' && data !== null) {
serializedData = Ajax.serialize(data);
var join = url.indexOf('?') > -1 ? '&' : '?';
url = url + join + serializedData;
}
Ajax.request(url, 'GET', null, headers, callback);
return Ajax.request.apply(Ajax, [url, 'GET'].concat(args));
}

@@ -103,3 +90,3 @@ }, {

Ajax.request.apply(Ajax, [url, 'POST'].concat(args));
return Ajax.request.apply(Ajax, [url, 'POST'].concat(args));
}

@@ -113,3 +100,3 @@ }, {

Ajax.request.apply(Ajax, [url, 'PUT'].concat(args));
return Ajax.request.apply(Ajax, [url, 'PUT'].concat(args));
}

@@ -123,3 +110,3 @@ }, {

Ajax.request.apply(Ajax, [url, 'HEAD'].concat(args));
return Ajax.request.apply(Ajax, [url, 'HEAD'].concat(args));
}

@@ -133,3 +120,3 @@ }, {

Ajax.request.apply(Ajax, [url, 'DELETE'].concat(args));
return Ajax.request.apply(Ajax, [url, 'DELETE'].concat(args));
}

@@ -143,3 +130,3 @@ }, {

Ajax.request.apply(Ajax, [url, 'OPTIONS'].concat(args));
return Ajax.request.apply(Ajax, [url, 'OPTIONS'].concat(args));
}

@@ -193,3 +180,3 @@

if (headers === null) {
if (headers === null || typeof headers === 'undefined') {
headers = {};

@@ -206,2 +193,14 @@ }

if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object' && data !== null && method === 'GET') {
var serializedData = data;
if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object' && data !== null) {
serializedData = Ajax.serialize(data);
var join = url.indexOf('?') > -1 ? '&' : '?';
url = url + join + serializedData;
data = null;
}
}
var xhr = new XMLHttpRequest();

@@ -208,0 +207,0 @@

@@ -24,33 +24,23 @@ /* eslint-env browser */

static get(url, ...args) {
const [data, headers, callback] = args;
let serializedData = data;
if (typeof data === 'object' && data !== null) {
serializedData = Ajax.serialize(data);
const join = url.indexOf('?') > -1 ? '&' : '?';
url = url + join + serializedData;
}
Ajax.request(url, 'GET', null, headers, callback);
return Ajax.request(url, 'GET', ...args);
}
static post(url, ...args) {
Ajax.request(url, 'POST', ...args);
return Ajax.request(url, 'POST', ...args);
}
static put(url, ...args) {
Ajax.request(url, 'PUT', ...args);
return Ajax.request(url, 'PUT', ...args);
}
static head(url, ...args) {
Ajax.request(url, 'HEAD', ...args);
return Ajax.request(url, 'HEAD', ...args);
}
static del(url, ...args) {
Ajax.request(url, 'DELETE', ...args);
return Ajax.request(url, 'DELETE', ...args);
}
static options(url, ...args) {
Ajax.request(url, 'OPTIONS', ...args);
return Ajax.request(url, 'OPTIONS', ...args);
}

@@ -93,3 +83,3 @@

if (headers === null) {
if (headers === null || typeof headers === 'undefined') {
headers = {};

@@ -106,2 +96,15 @@ }

if (typeof data === 'object' &&
data !== null && method === 'GET') {
let serializedData = data;
if (typeof data === 'object' && data !== null) {
serializedData = Ajax.serialize(data);
const join = url.indexOf('?') > -1 ? '&' : '?';
url = url + join + serializedData;
data = null;
}
}
const xhr = new XMLHttpRequest();

@@ -108,0 +111,0 @@

{
"name": "bequest",
"version": "1.4.1",
"version": "1.4.2",
"description": "An ajax class",

@@ -11,3 +11,3 @@ "main": "dist/ajax.js",

"dev": "scriptkit dev",
"test": "echo \"Error: no test specified\" && exit 1",
"test": "cat test/bequest.test.dist.js | tape-run --static . --browser phantomjs --render tap-spec",
"prepublish": "scriptkit"

@@ -36,11 +36,13 @@ },

"eslint-config-firstandthird": "3.2.0",
"eslint-plugin-import": "2.7.0",
"scriptkit": "0.2.0"
"eslint-plugin-import": "2.2.0",
"phantomjs-prebuilt": "2.1.14",
"scriptkit": "0.2.0",
"tap-spec": "4.1.1",
"tape-rollup": "4.6.4",
"tape-run": "2.2.0"
},
"scriptkit": {
"test": {
"enabled": false
},
"files": {
"dist/ajax.js": "index.js"
"dist/ajax.js": "index.js",
"test/bequest.test.dist.js": "test/bequest.test.js"
},

@@ -47,0 +49,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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