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

chain-xhr

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

chain-xhr - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

118

chain-xhr.js

@@ -735,13 +735,51 @@ function createCommonjsModule(fn, module) {

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
var asyncToGenerator = _asyncToGenerator;
var _typeof_1 = createCommonjsModule(function (module) {
function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
function _typeof(obj) {
"@babel/helpers - typeof";
function _typeof(obj) {
if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return _typeof2(obj);
return typeof obj;
};
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

@@ -883,3 +921,3 @@ }

if (!this.METHODS[methodNormalized]) throw new Error('An unsupported http request method was chosen');
if (!this.METHODS.hasOwnProperty(methodNormalized)) throw new Error('An unsupported http request method was chosen');
this._request.method = methodNormalized;

@@ -1043,41 +1081,51 @@ return this;

key: "send",
value: function send() {
var _this = this;
value: function () {
var _send = asyncToGenerator(
/*#__PURE__*/
regenerator.mark(function _callee() {
var _this = this;
return regenerator.async(function send$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", new Promise(function (resolve, reject) {
_this._request.queryParams.map(function (queryParam) {
return _this._request.url.searchParams.append(queryParam.key, queryParam.value);
});
return regenerator.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", new Promise(function (resolve, reject) {
_this._request.queryParams.map(function (queryParam) {
return _this._request.url.searchParams.append(queryParam.key, queryParam.value);
});
_this._XHR = new XMLHttpRequest();
_this._XHR = new XMLHttpRequest();
_this._XHR.addEventListener('readystatechange', function () {
if (_this._XHR.readyState === 4 && _this._XHR.status >= 200) resolve(_this._XHR.response);else if (_this._XHR.status >= 400 && _this._XHR.status <= 600) reject();
});
_this._XHR.addEventListener('readystatechange', function () {
if (_this._XHR.readyState === 4 && _this._XHR.status >= 200) resolve(_this._XHR.response);else if (_this._XHR.status >= 400 && _this._XHR.status <= 600) reject();
});
_this._XHR.addEventListener('error', function (err) {
return reject(err);
});
_this._XHR.addEventListener('error', function (err) {
return reject(err);
});
_this._XHR.open(_this._request.method, _this._request.url.href, true);
_this._XHR.open(_this._request.method, _this._request.url.href, true);
_this._XHR.responseType = _this._request.responseType;
_this._XHR.withCredentials = _this._request.withCredentials;
_this._XHR.responseType = _this._request.responseType;
_this._XHR.withCredentials = _this._request.withCredentials;
_this._XHR.setRequestHeader('Content-Type', _this._request.contentType);
_this._XHR.setRequestHeader('Content-Type', _this._request.contentType);
_this._XHR.send(_this._request.data);
}));
_this._XHR.send(_this._request.data);
}));
case 1:
case "end":
return _context.stop();
case 1:
case "end":
return _context.stop();
}
}
}
});
}
}, _callee);
}));
function send() {
return _send.apply(this, arguments);
}
return send;
}()
}]);

@@ -1084,0 +1132,0 @@

@@ -0,1 +1,15 @@

0.2.0 / 2019-02-02
==================
* [FEATURE] Defined the Methods interface more clearly.
* [TEST] Changed the test setup to use require instead of import.
* [TEST] Added @ava/babel due to problems using import in tests.
* [MISC] Updated dependencies to their latest versions.
* [MISC] Updated license year to reflect year change.
* [MISC] Removed unnecessary spacing.
0.1.3 / 2019-12-19
==================
* [MISC] Updated dependencies to their latest versions.
* [MISC] Added more badges to README.
0.1.2 / 2019-11-10

@@ -13,2 +27,2 @@ ==================

==================
* Initial release
* Initial release
export {};

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

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

@@ -97,3 +99,3 @@

if (!this.METHODS[methodNormalized]) throw new Error('An unsupported http request method was chosen');
if (!this.METHODS.hasOwnProperty(methodNormalized)) throw new Error('An unsupported http request method was chosen');
this._request.method = methodNormalized;

@@ -257,44 +259,54 @@ return this;

key: "send",
value: function send() {
var _this = this;
value: function () {
var _send = (0, _asyncToGenerator2["default"])(
/*#__PURE__*/
_regenerator["default"].mark(function _callee() {
var _this = this;
return _regenerator["default"].async(function send$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", new Promise(function (resolve, reject) {
_this._request.queryParams.map(function (queryParam) {
return _this._request.url.searchParams.append(queryParam.key, queryParam.value);
});
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", new Promise(function (resolve, reject) {
_this._request.queryParams.map(function (queryParam) {
return _this._request.url.searchParams.append(queryParam.key, queryParam.value);
});
_this._XHR = new XMLHttpRequest();
_this._XHR = new XMLHttpRequest();
_this._XHR.addEventListener('readystatechange', function () {
if (_this._XHR.readyState === 4 && _this._XHR.status >= 200) resolve(_this._XHR.response);else if (_this._XHR.status >= 400 && _this._XHR.status <= 600) reject();
});
_this._XHR.addEventListener('readystatechange', function () {
if (_this._XHR.readyState === 4 && _this._XHR.status >= 200) resolve(_this._XHR.response);else if (_this._XHR.status >= 400 && _this._XHR.status <= 600) reject();
});
_this._XHR.addEventListener('error', function (err) {
return reject(err);
});
_this._XHR.addEventListener('error', function (err) {
return reject(err);
});
_this._XHR.open(_this._request.method, _this._request.url.href, true);
_this._XHR.open(_this._request.method, _this._request.url.href, true);
_this._XHR.responseType = _this._request.responseType;
_this._XHR.withCredentials = _this._request.withCredentials;
_this._XHR.responseType = _this._request.responseType;
_this._XHR.withCredentials = _this._request.withCredentials;
_this._XHR.setRequestHeader('Content-Type', _this._request.contentType);
_this._XHR.setRequestHeader('Content-Type', _this._request.contentType);
_this._XHR.send(_this._request.data);
}));
_this._XHR.send(_this._request.data);
}));
case 1:
case "end":
return _context.stop();
case 1:
case "end":
return _context.stop();
}
}
}
});
}
}, _callee);
}));
function send() {
return _send.apply(this, arguments);
}
return send;
}()
}]);
return ChainXHR;
}(), _temp);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiR0VUIiwiUE9TVCIsIlBVVCIsIkRFTEVURSIsIm1ldGhvZCIsIk1FVEhPRFMiLCJ3aXRoQ3JlZGVudGlhbHMiLCJjb250ZW50VHlwZSIsInF1ZXJ5UGFyYW1zIiwicmVzcG9uc2VUeXBlIiwidXJsIiwiX3JlcXVlc3QiLCJVUkwiLCJtZXRob2ROb3JtYWxpemVkIiwidG9VcHBlckNhc2UiLCJFcnJvciIsImtleSIsInZhbHVlIiwidmFsdWVOb3JtYWxpemVkIiwidG9TdHJpbmciLCJwdXNoIiwiZGF0YSIsIkZvcm1EYXRhIiwiSlNPTiIsInN0cmluZ2lmeSIsIl9YSF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ZScsIHRoaXMuX3JlcXVlc3QuY29udGVudFR5cGUpO1xuXG4gICAgICB0aGlzLl9YSFIuc2VuZCh0aGlzLl9yZXF1ZXN0LmRhdGEhKTtcbiAgICB9KTtcbiAgfVxufTtcbiJdfQ==

@@ -5,3 +5,6 @@ /**

export default interface Methods {
[method: string]: string;
GET: string;
POST: string;
PUT: string;
DELETE: string;
}

@@ -7,2 +7,2 @@ 'use strict';

;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbnRlcmZhY2VzL01ldGhvZHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFFQTs7OztBQU9DIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXHJcblxyXG4vKipcclxuICogRGVmaW5lcyB0aGUgc3RydWN0dXJlIG9mIHRoZSBNRVRIT0RTIGNvbnN0YW50IE9iamVjdC5cclxuICovXHJcbmV4cG9ydCBkZWZhdWx0IGludGVyZmFjZSBNZXRob2RzIHtcclxuXHJcbiAgW21ldGhvZDogc3RyaW5nXTogc3RyaW5nO1xyXG5cclxufTsiXX0=
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbnRlcmZhY2VzL01ldGhvZHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFFQTs7OztBQVFDIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbi8qKlxuICogRGVmaW5lcyB0aGUgc3RydWN0dXJlIG9mIHRoZSBNRVRIT0RTIGNvbnN0YW50IE9iamVjdC5cbiAqL1xuZXhwb3J0IGRlZmF1bHQgaW50ZXJmYWNlIE1ldGhvZHMge1xuICBHRVQ6IHN0cmluZztcbiAgUE9TVDogc3RyaW5nO1xuICBQVVQ6IHN0cmluZztcbiAgREVMRV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Bib29sZWFuO1xuXG4gIC8qKlxuICAgKiBUaGUgY29udGVudCB0eXBlIG9mIHRoZSBjb250ZW50IGJlaW5nIHNlbnQgdG8gdGhlIGVuZHBvaW50LlxuICAgKi9cbiAgY29udGVudFR5cGU6IHN0cmluZztcblxuICAvKipcbiAgICogVGhlIHF1ZXJ5IHBhcmFtZXRlcnMgdG8gYWRkIHRvIHRoZSBlbmQgb2YgdGhlIHJlcXVlc3QgdXJsLlxuICAgKi9cbiAgcXVlcnlQYXJhbXM6IEFycmF5PGFueT47XG5cbiAgLyoqXG4gICAqIFRoZSB0eXBlIG9mIGRhdGEgdGhhdCB0aGUgcmVzcG9uc2Ugc2hvdWxkIGJlLlxuICAgKi9cbiAgcmVzcG9uc2VUeXBlOiBzdHJpbmc7XG5cbiAgLyoqXG4gICAqIFRoZSBkYXRhIHRvIHNlbmQgd2l0aCB0aGUgcmVxdWVzdC5cbiAgICovXG4gIGRhdGE/OiBhbnk7XG59O1xuIl19
{
"name": "chain-xhr",
"version": "0.1.2",
"description": "As stated in the MDN docs, a XMLHttpRequest is the safest and most reliable way to make HTTP requests. chain-xhr aims to make making XHR requests as simple as possible through a chainable API",
"version": "0.2.0",
"description": "A XMLHttpRequest is the safest and most reliable way to make HTTP requests and chain-xhr aims to make making XHR requests as simple as possible through a chainable API",
"main": "chain-xhr.js",

@@ -20,3 +20,4 @@ "scripts": {

"./test/_setup-browser-env.js"
]
],
"babel": true
},

@@ -41,21 +42,22 @@ "repository": {

"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/plugin-proposal-class-properties": "^7.7.0",
"@babel/plugin-proposal-numeric-separator": "^7.2.0",
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.7.1",
"@babel/preset-typescript": "^7.7.2",
"ava": "^2.4.0",
"@ava/babel": "^1.0.0",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-numeric-separator": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/preset-typescript": "^7.8.3",
"ava": "^3.2.0",
"browser-env": "^3.3.0",
"rollup": "^1.26.4",
"rollup": "^1.31.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"typescript": "^3.7.2"
"typescript": "^3.7.5"
},
"dependencies": {
"@babel/runtime": "^7.7.2"
"@babel/runtime": "^7.8.4"
}
}

@@ -13,8 +13,9 @@ <div align="center">

[![NPM version](https://img.shields.io/npm/v/chain-xhr.svg?style=flat)](https://www.npmjs.com/package/chain-xhr)
[![Known Vulnerabilities](https://snyk.io/test/github/robertcorponoi/chain-xhr/badge.svg)](https://snyk.io/test/github/robertcorponoi/chain-xhr)
[![NPM downloads](https://img.shields.io/npm/dm/chain-xhr.svg?style=flat)](https://www.npmjs.com/package/chain-xhr)
<a href="https://badge.fury.io/js/chain-xhr"><img src="https://img.shields.io/github/issues/robertcorponoi/chain-xhr.svg" alt="issues" height="18"></a>
<a href="https://badge.fury.io/js/chain-xhr"><img src="https://img.shields.io/github/license/robertcorponoi/chain-xhr.svg" alt="license" height="18"></a>
[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/robertcorponoi)
[![NPM version](https://img.shields.io/npm/v/chain-xhr.svg?style=flat)](https://www.npmjs.com/package/chain-xhr)
[![Known Vulnerabilities](https://snyk.io/test/github/robertcorponoi/chain-xhr/badge.svg)](https://snyk.io/test/github/robertcorponoi/chain-xhr)
![npm](https://img.shields.io/npm/dt/chain-xhr)
[![NPM downloads](https://img.shields.io/npm/dm/chain-xhr.svg?style=flat)](https://www.npmjs.com/package/chain-xhr)
<a href="https://badge.fury.io/js/chain-xhr"><img src="https://img.shields.io/github/issues/robertcorponoi/chain-xhr.svg" alt="issues" height="18"></a>
<a href="https://badge.fury.io/js/chain-xhr"><img src="https://img.shields.io/github/license/robertcorponoi/chain-xhr.svg" alt="license" height="18"></a>
[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/robertcorponoi)

@@ -21,0 +22,0 @@ </div>

@@ -0,0 +0,0 @@ 'use strict'

@@ -10,6 +10,3 @@ 'use strict'

module.exports = class ChainXHR {
/**
* A constant that can be used to select the requested http request method from.
*
/** * A constant that can be used to select the requested http request method from. *
* Even if a request method is provided by hand, it will be double checked against the ones defined here to make sure that it

@@ -69,7 +66,5 @@ * is a valid request method.

url(url: string): ChainXHR {
this._request.url = new URL(url);
return this;
}

@@ -103,6 +98,5 @@

method(method: string): ChainXHR {
const methodNormalized = method.toUpperCase();
if (!this.METHODS[methodNormalized]) throw new Error('An unsupported http request method was chosen');
if (!this.METHODS.hasOwnProperty(methodNormalized)) throw new Error('An unsupported http request method was chosen');

@@ -112,3 +106,2 @@ this._request.method = methodNormalized;

return this;
}

@@ -133,7 +126,5 @@

withCredentials(): ChainXHR {
this._request.withCredentials = true;
return this;
}

@@ -158,7 +149,5 @@

contentType(contentType: string): ChainXHR {
this._request.contentType = contentType;
return this;
}

@@ -185,3 +174,2 @@

queryParam(key: string, value: (string | number | boolean)): ChainXHR {
const valueNormalized: string = value.toString();

@@ -192,3 +180,2 @@

return this;
}

@@ -219,3 +206,2 @@

data(data: (Object | string)): ChainXHR {
if (typeof data === 'object' && ((data instanceof FormData) === false)) data = JSON.stringify(data);

@@ -226,3 +212,2 @@

return this;
}

@@ -236,7 +221,5 @@

json(): ChainXHR {
this._request.responseType = 'json';
return this;
}

@@ -252,7 +235,5 @@

abort(): ChainXHR {
this._XHR.abort();
return this;
}

@@ -279,5 +260,3 @@

async send(): Promise<any> {
return new Promise((resolve, reject) => {
this._request.queryParams.map(queryParam => this._request.url!.searchParams.append(queryParam.key, queryParam.value));

@@ -288,7 +267,4 @@

this._XHR.addEventListener('readystatechange', () => {
if (this._XHR.readyState === 4 && this._XHR.status >= 200) resolve(this._XHR.response);
else if (this._XHR.status >= 400 && this._XHR.status <= 600) reject();
});

@@ -307,7 +283,4 @@

this._XHR.send(this._request.data!);
});
}
};
};

@@ -7,5 +7,6 @@ 'use strict'

export default interface Methods {
[method: string]: string;
};
GET: string;
POST: string;
PUT: string;
DELETE: string;
};

@@ -7,3 +7,2 @@ 'use strict'

export default interface Request {
/**

@@ -43,3 +42,2 @@ * The URL that the request should be sent to.

data?: any;
};
};
'use strict';
import browserEnv from 'browser-env';
const browserEnv = require('browser-env');
browserEnv();
browserEnv();

@@ -0,0 +0,0 @@ 'use strict'

@@ -0,0 +0,0 @@ {

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