Socket
Socket
Sign inDemoInstall

@commercetools/sdk-middleware-user-agent

Package Overview
Dependencies
Maintainers
8
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools/sdk-middleware-user-agent - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5

14

dist/commercetools-sdk-middleware-user-agent.cjs.js

@@ -12,16 +12,12 @@ 'use strict';

Node.js or in a browser environment. In other cases, this won't be even a
problem as webpack will provide the correct polyfill in the bundle.
problem as Rollup will provide the correct polyfill in the bundle.
The main advantage by doing it this way is that it allows to easily test
the code running in both environments, by overriding `global.window` in
the specific test.
If we were to use checks at compile time (e.g. `webpack.DefinePlugin`) it
would not be possible / easy to test such cases.
Same thing for defining different entry points.
The code below, on runtime, will evaluate the function expression, returning
`true` or `false` if `window` is a global object.
*/
// eslint-disable-next-line no-new-func
var isBrowser = new Function('try { return typeof window === "object" } catch (e) { return false }');
var isBrowser = function isBrowser() {
return typeof window !== 'undefined' && window.document && window.document.nodeType === 9;
};
function getSystemInfo() {

@@ -28,0 +24,0 @@ if (isBrowser()) return window.navigator.userAgent;

@@ -8,16 +8,12 @@ /* */

Node.js or in a browser environment. In other cases, this won't be even a
problem as webpack will provide the correct polyfill in the bundle.
problem as Rollup will provide the correct polyfill in the bundle.
The main advantage by doing it this way is that it allows to easily test
the code running in both environments, by overriding `global.window` in
the specific test.
If we were to use checks at compile time (e.g. `webpack.DefinePlugin`) it
would not be possible / easy to test such cases.
Same thing for defining different entry points.
The code below, on runtime, will evaluate the function expression, returning
`true` or `false` if `window` is a global object.
*/
// eslint-disable-next-line no-new-func
var isBrowser = new Function('try { return typeof window === "object" } catch (e) { return false }');
var isBrowser = function isBrowser() {
return typeof window !== 'undefined' && window.document && window.document.nodeType === 9;
};
function getSystemInfo() {

@@ -24,0 +20,0 @@ if (isBrowser()) return window.navigator.userAgent;

@@ -14,16 +14,12 @@ (function (global, factory) {

Node.js or in a browser environment. In other cases, this won't be even a
problem as webpack will provide the correct polyfill in the bundle.
problem as Rollup will provide the correct polyfill in the bundle.
The main advantage by doing it this way is that it allows to easily test
the code running in both environments, by overriding `global.window` in
the specific test.
If we were to use checks at compile time (e.g. `webpack.DefinePlugin`) it
would not be possible / easy to test such cases.
Same thing for defining different entry points.
The code below, on runtime, will evaluate the function expression, returning
`true` or `false` if `window` is a global object.
*/
// eslint-disable-next-line no-new-func
var isBrowser = new Function('try { return typeof window === "object" } catch (e) { return false }');
var isBrowser = function isBrowser() {
return typeof window !== 'undefined' && window.document && window.document.nodeType === 9;
};
function getSystemInfo() {

@@ -30,0 +26,0 @@ if (isBrowser()) return window.navigator.userAgent;

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

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.CommercetoolsSdkMiddlewareUserAgent={})}(this,function(e){"use strict";var r=new Function('try { return typeof window === "object" } catch (e) { return false }');function t(e){if(!e||0===Object.keys(e).length||!{}.hasOwnProperty.call(e,"name"))throw new Error("Missing required option `name`");var t=e.version?e.name+"/"+e.version:e.name,n=void 0;e.libraryName&&!e.libraryVersion?n=e.libraryName:e.libraryName&&e.libraryVersion&&(n=e.libraryName+"/"+e.libraryVersion);var o=void 0;return e.contactUrl&&!e.contactEmail?o="(+"+e.contactUrl+")":!e.contactUrl&&e.contactEmail?o="(+"+e.contactEmail+")":e.contactUrl&&e.contactEmail&&(o="(+"+e.contactUrl+"; +"+e.contactEmail+")"),[t,r()?window.navigator.userAgent:"Node.js/"+process.version.slice(1)+" ("+process.platform+"; "+process.arch+")",n,o].filter(function(e){return Boolean(e)}).join(" ")}var n=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};e.createUserAgentMiddleware=function(e){var r=t(n({name:"commercetools-js-sdk"},e));return function(e){return function(t,o){var a=n({},t,{headers:n({},t.headers,{"User-Agent":r})});e(a,o)}}},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.CommercetoolsSdkMiddlewareUserAgent={})}(this,function(e){"use strict";var r=function(){return"undefined"!=typeof window&&window.document&&9===window.document.nodeType};function n(e){if(!e||0===Object.keys(e).length||!{}.hasOwnProperty.call(e,"name"))throw new Error("Missing required option `name`");var n=e.version?e.name+"/"+e.version:e.name,t=void 0;e.libraryName&&!e.libraryVersion?t=e.libraryName:e.libraryName&&e.libraryVersion&&(t=e.libraryName+"/"+e.libraryVersion);var o=void 0;return e.contactUrl&&!e.contactEmail?o="(+"+e.contactUrl+")":!e.contactUrl&&e.contactEmail?o="(+"+e.contactEmail+")":e.contactUrl&&e.contactEmail&&(o="(+"+e.contactUrl+"; +"+e.contactEmail+")"),[n,r()?window.navigator.userAgent:"Node.js/"+process.version.slice(1)+" ("+process.platform+"; "+process.arch+")",t,o].filter(function(e){return Boolean(e)}).join(" ")}var t=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e};e.createUserAgentMiddleware=function(e){var r=n(t({name:"commercetools-js-sdk"},e));return function(e){return function(n,o){var a=t({},n,{headers:t({},n.headers,{"User-Agent":r})});e(a,o)}}},Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=commercetools-sdk-middleware-user-agent.umd.min.js.map

@@ -7,3 +7,3 @@ {

"name": "@commercetools/sdk-middleware-user-agent",
"version": "1.2.4",
"version": "1.2.5",
"description": "Middleware for setting the User-Agent on the HTTP request, to use with @commercetools/sdk-client",

@@ -39,4 +39,4 @@ "keywords": [

"dependencies": {
"@commercetools/http-user-agent": "^1.1.4"
"@commercetools/http-user-agent": "^1.1.5"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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