Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@paypal/paypal-js

Package Overview
Dependencies
Maintainers
29
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paypal/paypal-js - npm Package Compare versions

Comparing version 2.1.4 to 2.1.5

4

dist/paypal.browser.js
/*!
* paypal-js v2.1.4 (2021-01-29T20:25:44.260Z)
* paypal-js v2.1.5 (2021-02-02T21:34:21.956Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -157,3 +157,3 @@ *

var version = '2.1.4';
var version = '2.1.5';

@@ -160,0 +160,0 @@ exports.loadScript = loadScript;

/*!
* paypal-js v2.1.4 (2021-01-29T20:25:44.260Z)
* paypal-js v2.1.5 (2021-02-02T21:34:21.956Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -17,2 +17,2 @@ *

*/
var paypalLoadScript=function(t){"use strict";function r(t){var r="";return n(t,(function(e){0!==r.length&&(r+="&"),r+=e+"="+t[e]})),r}function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=document.createElement("script");return e.src=t,n(r,(function(t){e.setAttribute(t,r[t]),"data-csp-nonce"===t&&e.setAttribute("nonce",r["data-csp-nonce"])})),e}function n(t,r){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&r(e)}function a(t){var r=0;return n(t,(function(){return r++})),r}var o,i=!1;return t.loadScript=function(t,u){if(!(t instanceof Object))throw new Error("Invalid arguments. Expected an object to be passed into loadScript().");if(void 0===u){if("undefined"==typeof Promise)throw new Error("Failed to load the PayPal JS SDK script because Promise is undefined. To resolve the issue, use a Promise polyfill.");u=Promise}return i?o:o=new u((function(o,u){if("undefined"==typeof window)return o(null);var c=function(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);var a={queryParams:{},dataAttributes:{}};n(t,(function(r){var e="data-"===r.substring(0,5)?"dataAttributes":"queryParams";a[e][r]=t[r].toString()}));var o=a.queryParams,i=a.dataAttributes;return{url:"".concat(e,"?").concat(r(o)),dataAttributes:i}}(t),s=c.url,d=c.dataAttributes;if(function(t,r){var o=document.querySelector('script[src="'.concat(t,'"]'));if(null===o)return null;var i=e(t,r);if(a(o.dataset)!==a(i.dataset))return null;var u=!0;return n(o.dataset,(function(t){o.dataset[t]!==i.dataset[t]&&(u=!1)})),u?o:null}(s,d)&&window.paypal)return o(window.paypal);i=!0,function(t){var r=t.url,n=t.dataAttributes,a=t.onSuccess,o=t.onError,i=e(r,n);i.onerror=o,i.onload=a,document.head.insertBefore(i,document.head.firstElementChild)}({url:s,dataAttributes:d,onSuccess:function(){return i=!1,window.paypal?o(window.paypal):u(new Error("The window.paypal global variable is not available."))},onError:function(){return i=!1,u(new Error('The script "'.concat(s,"\" didn't load correctly.")))}})}))},t.version="2.1.4",Object.defineProperty(t,"__esModule",{value:!0}),t}({});paypalLoadScript=paypalLoadScript.loadScript;
var paypalLoadScript=function(t){"use strict";function r(t){var r="";return n(t,(function(e){0!==r.length&&(r+="&"),r+=e+"="+t[e]})),r}function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=document.createElement("script");return e.src=t,n(r,(function(t){e.setAttribute(t,r[t]),"data-csp-nonce"===t&&e.setAttribute("nonce",r["data-csp-nonce"])})),e}function n(t,r){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&r(e)}function a(t){var r=0;return n(t,(function(){return r++})),r}var o,i=!1;return t.loadScript=function(t,u){if(!(t instanceof Object))throw new Error("Invalid arguments. Expected an object to be passed into loadScript().");if(void 0===u){if("undefined"==typeof Promise)throw new Error("Failed to load the PayPal JS SDK script because Promise is undefined. To resolve the issue, use a Promise polyfill.");u=Promise}return i?o:o=new u((function(o,u){if("undefined"==typeof window)return o(null);var c=function(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);var a={queryParams:{},dataAttributes:{}};n(t,(function(r){var e="data-"===r.substring(0,5)?"dataAttributes":"queryParams";a[e][r]=t[r].toString()}));var o=a.queryParams,i=a.dataAttributes;return{url:"".concat(e,"?").concat(r(o)),dataAttributes:i}}(t),s=c.url,d=c.dataAttributes;if(function(t,r){var o=document.querySelector('script[src="'.concat(t,'"]'));if(null===o)return null;var i=e(t,r);if(a(o.dataset)!==a(i.dataset))return null;var u=!0;return n(o.dataset,(function(t){o.dataset[t]!==i.dataset[t]&&(u=!1)})),u?o:null}(s,d)&&window.paypal)return o(window.paypal);i=!0,function(t){var r=t.url,n=t.dataAttributes,a=t.onSuccess,o=t.onError,i=e(r,n);i.onerror=o,i.onload=a,document.head.insertBefore(i,document.head.firstElementChild)}({url:s,dataAttributes:d,onSuccess:function(){return i=!1,window.paypal?o(window.paypal):u(new Error("The window.paypal global variable is not available."))},onError:function(){return i=!1,u(new Error('The script "'.concat(s,"\" didn't load correctly.")))}})}))},t.version="2.1.5",Object.defineProperty(t,"__esModule",{value:!0}),t}({});paypalLoadScript=paypalLoadScript.loadScript;
/*!
* paypal-js v2.1.4 (2021-01-29T20:25:44.260Z)
* paypal-js v2.1.5 (2021-02-02T21:34:21.956Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -154,4 +154,4 @@ *

var version = '2.1.4';
var version = '2.1.5';
export { loadScript, version };
/*!
* paypal-js v2.1.4 (2021-01-29T20:25:44.260Z)
* paypal-js v2.1.5 (2021-02-02T21:34:21.956Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -466,3 +466,3 @@ *

// replaced with the package.json version at build time
const version = '2.1.4';
const version = '2.1.5';

@@ -469,0 +469,0 @@ exports.loadScript = loadScript$1;

/*!
* paypal-js v2.1.4 (2021-01-29T20:25:44.260Z)
* paypal-js v2.1.5 (2021-02-02T21:34:21.956Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -17,2 +17,2 @@ *

*/
var paypalLoadScript=function(t){"use strict";var e=setTimeout;function n(t){return Boolean(t&&void 0!==t.length)}function r(){}function o(t){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}function f(t){let e="";return p(t,(n=>{0!==e.length&&(e+="&"),e+=n+"="+t[n]})),e}function d(t,e={}){const n=document.createElement("script");return n.src=t,p(e,(t=>{n.setAttribute(t,e[t]),"data-csp-nonce"===t&&n.setAttribute("nonce",e["data-csp-nonce"])})),n}function p(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n)}function h(t){let e=0;return p(t,(()=>e++)),e}let y;o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.prototype.finally=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))},o.all=function(t){return new o((function(e,r){if(!n(t))return r(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);var i=o.length;function a(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var u=n.then;if("function"==typeof u)return void u.call(n,(function(e){a(t,e)}),r)}o[t]=n,0==--i&&e(o)}catch(t){r(t)}}for(var u=0;u<o.length;u++)a(u,o[u])}))},o.allSettled=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,n){if(n&&("object"==typeof n||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(e){i(t,e)}),(function(n){r[t]={status:"rejected",reason:n},0==--o&&e(r)}))}r[t]={status:"fulfilled",value:n},0==--o&&e(r)}for(var a=0;a<r.length;a++)i(a,r[a])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,r){if(!n(t))return r(new TypeError("Promise.race accepts an array"));for(var i=0,a=t.length;i<a;i++)o.resolve(t[i]).then(e,r)}))},o._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){e(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};let v=!1;function w(t,e){if(!(t instanceof Object))throw new Error("Invalid arguments. Expected an object to be passed into loadScript().");if(void 0===e){if("undefined"==typeof Promise)throw new Error("Failed to load the PayPal JS SDK script because Promise is undefined. To resolve the issue, use a Promise polyfill.");e=Promise}return v?y:y=new e(((e,n)=>{if("undefined"==typeof window)return e(null);const{url:r,dataAttributes:o}=function(t){let e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);const n={queryParams:{},dataAttributes:{}};p(t,(e=>{const r="data-"===e.substring(0,5)?"dataAttributes":"queryParams";n[r][e]=t[e].toString()}));const{queryParams:r,dataAttributes:o}=n;return{url:`${e}?${f(r)}`,dataAttributes:o}}(t);if(function(t,e){const n=document.querySelector(`script[src="${t}"]`);if(null===n)return null;const r=d(t,e);if(h(n.dataset)!==h(r.dataset))return null;let o=!0;return p(n.dataset,(t=>{n.dataset[t]!==r.dataset[t]&&(o=!1)})),o?n:null}(r,o)&&window.paypal)return e(window.paypal);v=!0,function({url:t,dataAttributes:e,onSuccess:n,onError:r}){const o=d(t,e);o.onerror=r,o.onload=n,document.head.insertBefore(o,document.head.firstElementChild)}({url:r,dataAttributes:o,onSuccess:()=>(v=!1,window.paypal?e(window.paypal):n(new Error("The window.paypal global variable is not available."))),onError:()=>(v=!1,n(new Error(`The script "${r}" didn't load correctly.`)))})}))}return t.loadScript=function(t){return w(t,o)},t.version="2.1.4",Object.defineProperty(t,"__esModule",{value:!0}),t}({});paypalLoadScript=paypalLoadScript.loadScript;
var paypalLoadScript=function(t){"use strict";var e=setTimeout;function n(t){return Boolean(t&&void 0!==t.length)}function r(){}function o(t){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}function f(t){let e="";return p(t,(n=>{0!==e.length&&(e+="&"),e+=n+"="+t[n]})),e}function d(t,e={}){const n=document.createElement("script");return n.src=t,p(e,(t=>{n.setAttribute(t,e[t]),"data-csp-nonce"===t&&n.setAttribute("nonce",e["data-csp-nonce"])})),n}function p(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n)}function h(t){let e=0;return p(t,(()=>e++)),e}let y;o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.prototype.finally=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))},o.all=function(t){return new o((function(e,r){if(!n(t))return r(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);var i=o.length;function a(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var u=n.then;if("function"==typeof u)return void u.call(n,(function(e){a(t,e)}),r)}o[t]=n,0==--i&&e(o)}catch(t){r(t)}}for(var u=0;u<o.length;u++)a(u,o[u])}))},o.allSettled=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,n){if(n&&("object"==typeof n||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(e){i(t,e)}),(function(n){r[t]={status:"rejected",reason:n},0==--o&&e(r)}))}r[t]={status:"fulfilled",value:n},0==--o&&e(r)}for(var a=0;a<r.length;a++)i(a,r[a])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,r){if(!n(t))return r(new TypeError("Promise.race accepts an array"));for(var i=0,a=t.length;i<a;i++)o.resolve(t[i]).then(e,r)}))},o._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){e(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};let v=!1;function w(t,e){if(!(t instanceof Object))throw new Error("Invalid arguments. Expected an object to be passed into loadScript().");if(void 0===e){if("undefined"==typeof Promise)throw new Error("Failed to load the PayPal JS SDK script because Promise is undefined. To resolve the issue, use a Promise polyfill.");e=Promise}return v?y:y=new e(((e,n)=>{if("undefined"==typeof window)return e(null);const{url:r,dataAttributes:o}=function(t){let e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);const n={queryParams:{},dataAttributes:{}};p(t,(e=>{const r="data-"===e.substring(0,5)?"dataAttributes":"queryParams";n[r][e]=t[e].toString()}));const{queryParams:r,dataAttributes:o}=n;return{url:`${e}?${f(r)}`,dataAttributes:o}}(t);if(function(t,e){const n=document.querySelector(`script[src="${t}"]`);if(null===n)return null;const r=d(t,e);if(h(n.dataset)!==h(r.dataset))return null;let o=!0;return p(n.dataset,(t=>{n.dataset[t]!==r.dataset[t]&&(o=!1)})),o?n:null}(r,o)&&window.paypal)return e(window.paypal);v=!0,function({url:t,dataAttributes:e,onSuccess:n,onError:r}){const o=d(t,e);o.onerror=r,o.onload=n,document.head.insertBefore(o,document.head.firstElementChild)}({url:r,dataAttributes:o,onSuccess:()=>(v=!1,window.paypal?e(window.paypal):n(new Error("The window.paypal global variable is not available."))),onError:()=>(v=!1,n(new Error(`The script "${r}" didn't load correctly.`)))})}))}return t.loadScript=function(t){return w(t,o)},t.version="2.1.5",Object.defineProperty(t,"__esModule",{value:!0}),t}({});paypalLoadScript=paypalLoadScript.loadScript;
/*!
* paypal-js v2.1.4 (2021-01-29T20:25:44.260Z)
* paypal-js v2.1.5 (2021-02-02T21:34:21.956Z)
* Copyright 2020-present, PayPal, Inc. All rights reserved.

@@ -158,5 +158,5 @@ *

var version = '2.1.4';
var version = '2.1.5';
exports.loadScript = loadScript;
exports.version = version;
{
"name": "@paypal/paypal-js",
"version": "2.1.4",
"version": "2.1.5",
"description": "Client-side loader for the PayPal JS SDK",

@@ -5,0 +5,0 @@ "main": "dist/paypal.node.js",

@@ -10,2 +10,3 @@ interface PayPalScriptQueryParameters {

'disable-funding'?: string;
'enable-funding'?: string;
'disable-card'?: string;

@@ -12,0 +13,0 @@ 'integration-date'?: string;

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