fetch-plus-csrf
Advanced tools
Comparing version 3.5.0 to 3.9.2
@@ -1,1 +0,134 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["fetch-plus-csrf"]=t():e["fetch-plus-csrf"]=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";var n=o(1);e.exports=function(e,t){return function(o){return t&&(o.options.headers[e]=(0,n.compute)(t)),function(o){return o.headers&&o.headers.has&&o.headers.has(e)&&(t=o.headers.get(e)),o}}}},function(e,t){"use strict";function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function n(e){return"function"==typeof e?e():e}function r(e){var t={};return e=n(e),Object.keys(e).forEach(function(u){var c=e[u];t[u]="object"===("undefined"==typeof c?"undefined":o(c))?r(c):n(c)}),t}e.exports={compute:n,computeObject:r}}])}); | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(); | ||
else if(typeof define === 'function' && define.amd) | ||
define([], factory); | ||
else if(typeof exports === 'object') | ||
exports["fetch-plus-csrf"] = factory(); | ||
else | ||
root["fetch-plus-csrf"] = factory(); | ||
})(this, function() { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ }; | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var _compute = __webpack_require__(1); | ||
// Export using middleware direct notation. | ||
module.exports = function (headerName, currentValue) { | ||
return function (request) { | ||
if (currentValue) { | ||
request.options.headers[headerName] = (0, _compute.compute)(currentValue); | ||
} | ||
return function (response) { | ||
if (response.headers && response.headers.has && response.headers.has(headerName)) { | ||
currentValue = response.headers.get(headerName); | ||
} | ||
return response; | ||
}; | ||
}; | ||
}; /** | ||
* @copyright © 2015, Rick Wong. All rights reserved. | ||
*/ | ||
/***/ }, | ||
/* 1 */ | ||
/***/ function(module, exports) { | ||
"use strict"; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
/** | ||
* @copyright © 2015, Rick Wong. All rights reserved. | ||
*/ | ||
var _isScalar = function _isScalar(value) { | ||
return value === undefined || value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean"; | ||
}; | ||
var compute = function compute(value) { | ||
return typeof value === "function" ? value() : value; | ||
}; | ||
var computeObject = function computeObject(object) { | ||
object = compute(object); | ||
if (_isScalar(object)) { | ||
return object; | ||
} | ||
var mapped = {}; | ||
Object.keys(object).forEach(function (key) { | ||
var value = object[key]; | ||
if (_isScalar(value)) { | ||
mapped[key] = value; | ||
} else if (typeof FormData === "function" && value instanceof FormData) { | ||
mapped[key] = value; | ||
} else if ((typeof value === "undefined" ? "undefined" : _typeof(value)) === "object") { | ||
mapped[key] = computeObject(value); | ||
} else { | ||
mapped[key] = compute(value); | ||
} | ||
}); | ||
return mapped; | ||
}; | ||
module.exports = { | ||
compute: compute, | ||
computeObject: computeObject | ||
}; | ||
/***/ } | ||
/******/ ]) | ||
}); | ||
; |
{ | ||
"name": "fetch-plus-csrf", | ||
"description": "A convenient Fetch API library with first-class middleware support", | ||
"version": "3.5.0", | ||
"version": "3.9.2", | ||
"license": "BSD-3-Clause", | ||
@@ -6,0 +6,0 @@ "repository": { |
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
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
4670
103
0