fetch-plus-bearerauth
Advanced tools
Comparing version 3.5.0 to 3.9.0
@@ -1,1 +0,115 @@ | ||
!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-bearerauth"]=t():e["fetch-plus-bearerauth"]=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){return function(t){t.options.headers.Authorization="Bearer "+(0,n.compute)(e)}}},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-bearerauth"] = factory(); | ||
else | ||
root["fetch-plus-bearerauth"] = 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 creation notation. | ||
module.exports = function (token) { | ||
return function (request) { | ||
if (token != null) { | ||
request.options.headers["Authorization"] = "Bearer " + (0, _compute.compute)(token); | ||
} | ||
}; | ||
}; /** | ||
* @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. | ||
*/ | ||
function compute(value) { | ||
return typeof value === "function" ? value() : value; | ||
} | ||
function computeObject(object) { | ||
var mapped = {}; | ||
object = compute(object); | ||
Object.keys(object).forEach(function (key) { | ||
var value = object[key]; | ||
if (value === null) { | ||
mapped[key] = null; | ||
} else if (typeof FormData === "function" && value instanceof FormData) { | ||
mapped[key] = value; | ||
} else { | ||
mapped[key] = (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object" ? computeObject(value) : compute(value); | ||
} | ||
}); | ||
return mapped; | ||
} | ||
module.exports = { | ||
compute: compute, | ||
computeObject: computeObject | ||
}; | ||
/***/ } | ||
/******/ ]) | ||
}); | ||
; |
{ | ||
"name": "fetch-plus-bearerauth", | ||
"description": "A convenient Fetch API library with first-class middleware support", | ||
"version": "3.5.0", | ||
"version": "3.9.0", | ||
"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
4171
89
0