@highpoint/js-fetch
Advanced tools
Comparing version 1.1.0 to 2.0.1
@@ -0,1 +1,8 @@ | ||
# v2.0.1 | ||
* Retrieve `baseURI` before each request so if `<base href>` changes, the change | ||
will take effect. | ||
# v2.0.0 | ||
* Export ES modules instead of CommonJS | ||
# v1.1.0 | ||
@@ -2,0 +9,0 @@ * Throw exception when device is offline |
@@ -1,9 +0,5 @@ | ||
'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _this = this; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
@@ -13,3 +9,5 @@ | ||
var baseURI = (document.baseURI || document.querySelector('base').href).replace(/IScript_.*/, 'IScript_'); | ||
var getBaseURI = function getBaseURI() { | ||
return (document.baseURI || document.querySelector('base').href).replace(/IScript_.*/, 'IScript_'); | ||
}; | ||
@@ -94,3 +92,3 @@ var isFramed = function () { | ||
} | ||
}, _callee, undefined); | ||
}, _callee, _this); | ||
})); | ||
@@ -117,6 +115,6 @@ | ||
if (isFramed) { | ||
parent.postMessage('is-active', '*'); // Let parent know child is active | ||
window.parent.postMessage('is-active', '*'); // Let parent know child is active | ||
} | ||
if (isOffline()) throw new Error('Network Error. Are you offline?'); | ||
return fetch(url.indexOf('http') === 0 ? url : baseURI + url, _extends({ | ||
return fetch(url.indexOf('http') === 0 ? url : getBaseURI() + url, _extends({ | ||
method: method, | ||
@@ -179,3 +177,3 @@ credentials: credentials, | ||
var json = exports.json = function () { | ||
export var json = function () { | ||
var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { | ||
@@ -200,3 +198,3 @@ var response, | ||
} | ||
}, _callee2, undefined); | ||
}, _callee2, _this); | ||
})); | ||
@@ -209,3 +207,3 @@ | ||
var postForm = exports.postForm = function () { | ||
export var postForm = function () { | ||
var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() { | ||
@@ -230,3 +228,3 @@ var response, | ||
} | ||
}, _callee3, undefined); | ||
}, _callee3, _this); | ||
})); | ||
@@ -239,3 +237,3 @@ | ||
var postJSON = exports.postJSON = function () { | ||
export var postJSON = function () { | ||
var _ref8 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() { | ||
@@ -260,3 +258,3 @@ var response, | ||
} | ||
}, _callee4, undefined); | ||
}, _callee4, _this); | ||
})); | ||
@@ -269,3 +267,3 @@ | ||
var postRaw = exports.postRaw = function () { | ||
export var postRaw = function () { | ||
var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(url, args) { | ||
@@ -289,3 +287,3 @@ var response; | ||
} | ||
}, _callee5, undefined); | ||
}, _callee5, _this); | ||
})); | ||
@@ -292,0 +290,0 @@ |
{ | ||
"name": "@highpoint/js-fetch", | ||
"version": "1.1.0", | ||
"version": "2.0.1", | ||
"description": "HighPoint Fetch Library", | ||
@@ -15,2 +15,3 @@ "main": "dist/js-fetch.js", | ||
"devDependencies": { | ||
"@highpoint/eslint-config": "^0.1.1", | ||
"babel-cli": "^6.26.0", | ||
@@ -20,9 +21,16 @@ "babel-eslint": "^8.2.6", | ||
"babel-preset-env": "^1.7.0", | ||
"chai": "^4.1.2", | ||
"eslint": "^5.2.0", | ||
"eslint-config-prettier": "^2.9.0", | ||
"husky": "^0.14.3", | ||
"karma": "^3.0.0", | ||
"karma-chai": "^0.1.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-mocha": "^1.3.0", | ||
"lint-staged": "^7.2.0", | ||
"mkdirp": "^0.5.1", | ||
"mocha": "^5.2.0", | ||
"npm-run-all": "^4.1.3", | ||
"prettier": "^1.13.7", | ||
"query-string": "^6.1.0", | ||
"rimraf": "^2.6.2" | ||
@@ -35,5 +43,6 @@ }, | ||
"prebuild": "mkdirp dist", | ||
"precommit": "lint-staged", | ||
"prepack": "run-s clean build" | ||
"precommit": "yarn test && lint-staged", | ||
"prepack": "run-s clean build", | ||
"test": "karma start karma.conf.js --single-run" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14099
20
232