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

http-otro

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-otro - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

15

dist/http-otro.js

@@ -91,2 +91,4 @@ (function webpackUniversalModuleDefinition(root, factory) {

exports.queryURL = queryURL;
exports.default = function () {

@@ -114,6 +116,2 @@ var defaults = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

var queryURL = function queryURL(resource, qs) {
return qs.length ? [resource, qs].join('?') : resource;
};
context.request = function (resource, method) {

@@ -200,2 +198,11 @@ var body = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];

function queryURL(resource, qs) {
if (!qs.length) return resource;
var joinWith = '?';
if (resource.indexOf('?') > -1) joinWith = '&';
return qs.length ? [resource, qs].join(joinWith) : resource;
}
/***/ },

@@ -202,0 +209,0 @@ /* 2 */

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["http-otro"]=e():t["http-otro"]=e()}(this,function(){return function(t){function e(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.response=e.client=void 0;var i=r(1),s=n(i),a=r(2),u=o(a);e.client=s.default,e.response=u},function(t,e,r){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};t.headers||(t.headers={}),e.defaults=t;var r=t.host||"",o=function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e.length>0?e.join("&"):""},i=function(t,e){return e.length?[t,e].join("?"):t};e.request=function(o,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i=i.toUpperCase();var f={method:i,headers:{}};for(var d in e.defaults)"headers"!=d&&(f[d]=t[d]);for(var d in u)"headers"!=d&&(f[d]=u[d]);for(var d in u.headers)f.headers[d]=u.headers[d];for(var d in e.defaults.headers)f.headers[d]=t.headers[d];return f.headers["Content-Type"]||f.headers["Content-Type"]===!1||(f.headers["Content-Type"]="application/json"),"GET"!=i&&(f.body="object"==(void 0===a?"undefined":n(a))?JSON.stringify(a):a),(0,s.default)(r+o,f)},e.get=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=o(r);return e.request(i(t,s),"GET",{},n)};var a=function(t){e[t]=function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.request(r,t.toUpperCase(),o,n)}};return["put","patch","post"].forEach(function(t){return a(t)}),e.del=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=o(r);return e.request(i(t,s),"DELETE",{},n)},e};var i=r(3),s=o(i)},function(t,e){"use strict";function r(t){return new Promise(function(e,r){t.then(function(t){return t.json()}).then(function(t){e(t)}).catch(function(t){r(t)})})}function o(t){return new Promise(function(e,r){t.then(function(t){return t.body()}).then(function(t){e(t)}).catch(function(t){r(t)})})}Object.defineProperty(e,"__esModule",{value:!0}),e.json=r,e.body=o},function(t,e,r){r(4),t.exports=self.fetch.bind(self)},function(t,e){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t+=""),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t+=""),t}function o(t){this.map={},t instanceof o?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function n(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function i(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader;return e.readAsArrayBuffer(t),i(e)}function a(t){var e=new FileReader;return e.readAsText(t),i(e)}function u(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(p.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(p.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(t){if(!p.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type))},p.blob?(this.blob=function(){var t=n(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var t=n(this);if(t)return t;if(this._bodyBlob)return a(this._bodyBlob);if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=n(this);return t?t:Promise.resolve(this._bodyText)},p.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(t){var e=t.toUpperCase();return y.indexOf(e)>-1?e:t}function d(t,e){e=e||{};var r=e.body;if(d.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,r||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new o(e.headers)),this.method=f(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function h(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}}),e}function c(t){var e=new o,r=t.getAllResponseHeaders().trim().split("\n");return r.forEach(function(t){var r=t.trim().split(":"),o=r.shift().trim(),n=r.join(":").trim();e.append(o,n)}),e}function l(t,e){e||(e={}),this.type="default",this.status=e.status,this.ok=this.status>=200&&300>this.status,this.statusText=e.statusText,this.headers=e.headers instanceof o?e.headers:new o(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){o.prototype.append=function(t,o){t=e(t),o=r(o);var n=this.map[t];n||(n=[],this.map[t]=n),n.push(o)},o.prototype.delete=function(t){delete this.map[e(t)]},o.prototype.get=function(t){var r=this.map[e(t)];return r?r[0]:null},o.prototype.getAll=function(t){return this.map[e(t)]||[]},o.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},o.prototype.set=function(t,o){this.map[e(t)]=[r(o)]},o.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(o){t.call(e,o,r,this)},this)},this)};var p={blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t},y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this)},u.call(d.prototype),u.call(l.prototype),l.prototype.clone=function(){return new l(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},l.error=function(){var t=new l(null,{status:0,statusText:""});return t.type="error",t};var b=[301,302,303,307,308];l.redirect=function(t,e){if(-1===b.indexOf(e))throw new RangeError("Invalid status code");return new l(null,{status:e,headers:{location:t}})},t.Headers=o,t.Request=d,t.Response=l,t.fetch=function(t,e){return new Promise(function(r,o){function n(){return"responseURL"in s?s.responseURL:/^X-Request-URL:/m.test(s.getAllResponseHeaders())?s.getResponseHeader("X-Request-URL"):void 0}var i;i=d.prototype.isPrototypeOf(t)&&!e?t:new d(t,e);var s=new XMLHttpRequest;s.onload=function(){var t=1223===s.status?204:s.status;if(100>t||t>599)return void o(new TypeError("Network request failed"));var e={status:t,statusText:s.statusText,headers:c(s),url:n()},i="response"in s?s.response:s.responseText;r(new l(i,e))},s.onerror=function(){o(new TypeError("Network request failed"))},s.open(i.method,i.url,!0),"include"===i.credentials&&(s.withCredentials=!0),"responseType"in s&&p.blob&&(s.responseType="blob"),i.headers.forEach(function(t,e){s.setRequestHeader(e,t)}),s.send(void 0===i._bodyInit?null:i._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["http-otro"]=e():t["http-otro"]=e()}(this,function(){return function(t){function e(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.response=e.client=void 0;var i=r(1),s=n(i),a=r(2),u=o(a);e.client=s.default,e.response=u},function(t,e,r){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!e.length)return t;var r="?";return t.indexOf("?")>-1&&(r="&"),e.length?[t,e].join(r):t}Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.queryURL=n,e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};t.headers||(t.headers={}),e.defaults=t;var r=t.host||"",o=function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e.length>0?e.join("&"):""};e.request=function(o,n){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n=n.toUpperCase();var f={method:n,headers:{}};for(var d in e.defaults)"headers"!=d&&(f[d]=t[d]);for(var d in u)"headers"!=d&&(f[d]=u[d]);for(var d in u.headers)f.headers[d]=u.headers[d];for(var d in e.defaults.headers)f.headers[d]=t.headers[d];return f.headers["Content-Type"]||f.headers["Content-Type"]===!1||(f.headers["Content-Type"]="application/json"),"GET"!=n&&(f.body="object"==(void 0===s?"undefined":i(s))?JSON.stringify(s):s),(0,a.default)(r+o,f)},e.get=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=o(r);return e.request(n(t,s),"GET",{},i)};var s=function(t){e[t]=function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.request(r,t.toUpperCase(),o,n)}};return["put","patch","post"].forEach(function(t){return s(t)}),e.del=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=o(r);return e.request(n(t,s),"DELETE",{},i)},e};var s=r(3),a=o(s)},function(t,e){"use strict";function r(t){return new Promise(function(e,r){t.then(function(t){return t.json()}).then(function(t){e(t)}).catch(function(t){r(t)})})}function o(t){return new Promise(function(e,r){t.then(function(t){return t.body()}).then(function(t){e(t)}).catch(function(t){r(t)})})}Object.defineProperty(e,"__esModule",{value:!0}),e.json=r,e.body=o},function(t,e,r){r(4),t.exports=self.fetch.bind(self)},function(t,e){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t+=""),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t+=""),t}function o(t){this.map={},t instanceof o?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function n(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function i(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader;return e.readAsArrayBuffer(t),i(e)}function a(t){var e=new FileReader;return e.readAsText(t),i(e)}function u(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(p.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(p.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(t){if(!p.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type))},p.blob?(this.blob=function(){var t=n(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var t=n(this);if(t)return t;if(this._bodyBlob)return a(this._bodyBlob);if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=n(this);return t?t:Promise.resolve(this._bodyText)},p.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(t){var e=t.toUpperCase();return y.indexOf(e)>-1?e:t}function d(t,e){e=e||{};var r=e.body;if(d.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,r||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new o(e.headers)),this.method=f(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function h(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}}),e}function c(t){var e=new o,r=t.getAllResponseHeaders().trim().split("\n");return r.forEach(function(t){var r=t.trim().split(":"),o=r.shift().trim(),n=r.join(":").trim();e.append(o,n)}),e}function l(t,e){e||(e={}),this.type="default",this.status=e.status,this.ok=this.status>=200&&300>this.status,this.statusText=e.statusText,this.headers=e.headers instanceof o?e.headers:new o(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){o.prototype.append=function(t,o){t=e(t),o=r(o);var n=this.map[t];n||(n=[],this.map[t]=n),n.push(o)},o.prototype.delete=function(t){delete this.map[e(t)]},o.prototype.get=function(t){var r=this.map[e(t)];return r?r[0]:null},o.prototype.getAll=function(t){return this.map[e(t)]||[]},o.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},o.prototype.set=function(t,o){this.map[e(t)]=[r(o)]},o.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(o){t.call(e,o,r,this)},this)},this)};var p={blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t},y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this)},u.call(d.prototype),u.call(l.prototype),l.prototype.clone=function(){return new l(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},l.error=function(){var t=new l(null,{status:0,statusText:""});return t.type="error",t};var b=[301,302,303,307,308];l.redirect=function(t,e){if(-1===b.indexOf(e))throw new RangeError("Invalid status code");return new l(null,{status:e,headers:{location:t}})},t.Headers=o,t.Request=d,t.Response=l,t.fetch=function(t,e){return new Promise(function(r,o){function n(){return"responseURL"in s?s.responseURL:/^X-Request-URL:/m.test(s.getAllResponseHeaders())?s.getResponseHeader("X-Request-URL"):void 0}var i;i=d.prototype.isPrototypeOf(t)&&!e?t:new d(t,e);var s=new XMLHttpRequest;s.onload=function(){var t=1223===s.status?204:s.status;if(100>t||t>599)return void o(new TypeError("Network request failed"));var e={status:t,statusText:s.statusText,headers:c(s),url:n()},i="response"in s?s.response:s.responseText;r(new l(i,e))},s.onerror=function(){o(new TypeError("Network request failed"))},s.open(i.method,i.url,!0),"include"===i.credentials&&(s.withCredentials=!0),"responseType"in s&&p.blob&&(s.responseType="blob"),i.headers.forEach(function(t,e){s.setRequestHeader(e,t)}),s.send(void 0===i._bodyInit?null:i._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)}])});

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

exports.queryURL = queryURL;
exports.default = function () {

@@ -32,6 +34,2 @@ var defaults = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

var queryURL = function queryURL(resource, qs) {
return qs.length ? [resource, qs].join('?') : resource;
};
context.request = function (resource, method) {

@@ -116,2 +114,11 @@ var body = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function queryURL(resource, qs) {
if (!qs.length) return resource;
var joinWith = '?';
if (resource.indexOf('?') > -1) joinWith = '&';
return qs.length ? [resource, qs].join(joinWith) : resource;
}

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

exports.queryURL = queryURL;
exports.default = function () {

@@ -32,6 +34,2 @@ var defaults = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

var queryURL = function queryURL(resource, qs) {
return qs.length ? [resource, qs].join('?') : resource;
};
context.request = function (resource, method) {

@@ -116,2 +114,11 @@ var body = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function queryURL(resource, qs) {
if (!qs.length) return resource;
var joinWith = '?';
if (resource.indexOf('?') > -1) joinWith = '&';
return qs.length ? [resource, qs].join(joinWith) : resource;
}
{
"name": "http-otro",
"version": "0.0.7",
"version": "0.0.8",
"description": "Easily configurable basic http requests on top of isomorphic-fetch",

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

import fetch from 'isomorphic-fetch'
export function queryURL(resource, qs){
if(!qs.length) return resource;
let joinWith = '?';
if(resource.indexOf('?') > -1) joinWith = '&';
return qs.length ? [resource, qs].join(joinWith) : resource;
}
export default function(defaults={}){

@@ -23,6 +32,2 @@ var context = {};

const queryURL = (resource, qs)=>{
return qs.length ? [resource, qs].join('?') : resource;
}
context.request = (resource, method, body={}, options={})=>{

@@ -29,0 +34,0 @@ method = method.toUpperCase();

import expect from 'expect'
import { client, response } from '../src'
import { queryURL } from '../src/client'
import testServer from '../test-server'
describe('URLs should be formed as expected', ()=>{
it('Should handle adding query string correctly', ()=>{
var qs = 'a=1&b=2';
var url = 'http://foo.com/bar?baz=bop';
expect(queryURL(url, qs)).toBe(url+'&'+qs);
var url2 = 'http://foo.com';
expect(queryURL(url2, qs)).toBe(url2+'?'+qs);
});
});
describe('Requests should be configured as expected', ()=>{

@@ -69,2 +82,2 @@ let app;

});
})
});
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