@highpoint/js-fetch
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -19,2 +19,3 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
try { | ||
if (self.window === undefined) return false; | ||
return window.self !== window.top; | ||
@@ -32,4 +33,12 @@ } catch (e) { | ||
var getDefaultHeaders = function getDefaultHeaders() { | ||
if (self.document === undefined) return undefined; | ||
return { | ||
'X-CSRF-Token': getCookieValue('CSRFCookie') // Send CSRF token | ||
}; | ||
}; | ||
var isOffline = function isOffline() { | ||
return 'onLine' in window.navigator && !window.navigator.onLine; | ||
return 'onLine' in navigator && !navigator.onLine; | ||
}; | ||
@@ -147,5 +156,3 @@ | ||
method: method, | ||
headers: _objectSpread({ | ||
'X-CSRF-Token': getCookieValue('CSRFCookie') | ||
}, headers) | ||
headers: _objectSpread({}, getDefaultHeaders(), headers) | ||
}, otherArgs)); | ||
@@ -191,3 +198,3 @@ }; | ||
export var json = | ||
var json = | ||
/*#__PURE__*/ | ||
@@ -223,3 +230,4 @@ function () { | ||
}(); | ||
export var postForm = | ||
var postForm = | ||
/*#__PURE__*/ | ||
@@ -255,3 +263,4 @@ function () { | ||
}(); | ||
export var postJSON = | ||
var postJSON = | ||
/*#__PURE__*/ | ||
@@ -287,3 +296,4 @@ function () { | ||
}(); | ||
export var postRaw = | ||
var postRaw = | ||
/*#__PURE__*/ | ||
@@ -318,1 +328,3 @@ function () { | ||
}(); | ||
export { getBaseURI, getDefaultHeaders, json, postForm, postJSON, postRaw }; |
{ | ||
"name": "@highpoint/js-fetch", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "HighPoint Fetch Library", | ||
@@ -8,3 +8,3 @@ "main": "dist/js-fetch.js", | ||
"type": "git", | ||
"url": "git+https://github.com:hp-mobile/js-fetch.git" | ||
"url": "git+https://github.com:highpoint-tech/js-fetch.git" | ||
}, | ||
@@ -11,0 +11,0 @@ "author": "HighPoint <support@mhighpoint.com>", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15855
266
1