@paypal/paypal-js
Advanced tools
Comparing version 2.0.1 to 2.0.2
/*! | ||
* paypal-js v2.0.0 (2020-12-08T21:52:42.968Z) | ||
* paypal-js v2.0.2 (2020-12-08T22:07:33.198Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -156,3 +156,3 @@ * | ||
var version = '2.0.0'; | ||
var version = '2.0.2'; | ||
@@ -159,0 +159,0 @@ exports.loadScript = loadScript; |
/*! | ||
* paypal-js v2.0.0 (2020-12-08T21:52:42.968Z) | ||
* paypal-js v2.0.2 (2020-12-08T22:07:33.198Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -17,2 +17,2 @@ * | ||
*/ | ||
var paypalLoadScript=function(t){"use strict";function r(t){var r="";return a(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,a(r,(function(t){e.setAttribute(t,r[t])})),e}function a(t,r){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&r(e)}function n(t){var r=0;return a(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(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);var n={queryParams:{},dataAttributes:{}};a(t,(function(r){"data-"===r.substring(0,5)?n.dataAttributes[r]=t[r]:n.queryParams[r]=t[r]}));var o=n.queryParams,i=n.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(!o)return null;var i=e(t,r);if(n(o.dataset)!==n(i.dataset))return null;var u=!0;return a(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,a=t.dataAttributes,n=t.onSuccess,o=t.onError,i=e(r,a);i.onerror=o,i.onload=n,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.0.0",Object.defineProperty(t,"__esModule",{value:!0}),t}({});paypalLoadScript=paypalLoadScript.loadScript; | ||
var paypalLoadScript=function(t){"use strict";function r(t){var r="";return a(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,a(r,(function(t){e.setAttribute(t,r[t])})),e}function a(t,r){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&r(e)}function n(t){var r=0;return a(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(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);var n={queryParams:{},dataAttributes:{}};a(t,(function(r){"data-"===r.substring(0,5)?n.dataAttributes[r]=t[r]:n.queryParams[r]=t[r]}));var o=n.queryParams,i=n.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(!o)return null;var i=e(t,r);if(n(o.dataset)!==n(i.dataset))return null;var u=!0;return a(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,a=t.dataAttributes,n=t.onSuccess,o=t.onError,i=e(r,a);i.onerror=o,i.onload=n,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.0.2",Object.defineProperty(t,"__esModule",{value:!0}),t}({});paypalLoadScript=paypalLoadScript.loadScript; |
/*! | ||
* paypal-js v2.0.0 (2020-12-08T21:52:42.968Z) | ||
* paypal-js v2.0.2 (2020-12-08T22:07:33.198Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -153,4 +153,4 @@ * | ||
var version = '2.0.0'; | ||
var version = '2.0.2'; | ||
export { loadScript, version }; |
/*! | ||
* paypal-js v2.0.0 (2020-12-08T21:52:42.968Z) | ||
* paypal-js v2.0.2 (2020-12-08T22:07:33.198Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -481,3 +481,3 @@ * | ||
var version = '2.0.0'; | ||
var version = '2.0.2'; | ||
@@ -484,0 +484,0 @@ exports.loadScript = loadScript$1; |
/*! | ||
* paypal-js v2.0.0 (2020-12-08T21:52:42.968Z) | ||
* paypal-js v2.0.2 (2020-12-08T22:07:33.198Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -17,2 +17,2 @@ * | ||
*/ | ||
var paypalLoadScript=function(t){"use strict";var e,n=setTimeout;function r(t){return Boolean(t&&void 0!==t.length)}function o(){}function i(t){if(!(this instanceof i))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=[],s(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._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 c(e.promise,t)}u(e.promise,r)}else(1===t._state?u:c)(e.promise,t._value)}))):t._deferreds.push(e)}function u(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 i)return t._state=3,t._value=e,void f(t);if("function"==typeof n)return void s((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,f(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,f(t)}function f(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}function d(t){var e="";return h(t,(function(n){0!==e.length&&(e+="&"),e+=n+"="+t[n]})),e}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=document.createElement("script");return n.src=t,h(e,(function(t){n.setAttribute(t,e[t])})),n}function h(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n)}function v(t){var e=0;return h(t,(function(){return e++})),e}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new l(t,e,n)),n},i.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)}))}))},i.all=function(t){return new i((function(e,n){if(!r(t))return n(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,r){try{if(r&&("object"==typeof r||"function"==typeof r)){var u=r.then;if("function"==typeof u)return void u.call(r,(function(e){a(t,e)}),n)}o[t]=r,0==--i&&e(o)}catch(t){n(t)}}for(var u=0;u<o.length;u++)a(u,o[u])}))},i.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])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){if(!r(t))return n(new TypeError("Promise.race accepts an array"));for(var o=0,a=t.length;o<a;o++)i.resolve(t[o]).then(e,n)}))},i._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var y=!1;function w(t,n){if(!(t instanceof Object))throw new Error("Invalid arguments. Expected an object to be passed into loadScript().");if(void 0===n){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.");n=Promise}return y?e:e=new n((function(e,n){if("undefined"==typeof window)return e(null);var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);var n={queryParams:{},dataAttributes:{}};h(t,(function(e){"data-"===e.substring(0,5)?n.dataAttributes[e]=t[e]:n.queryParams[e]=t[e]}));var r=n.queryParams,o=n.dataAttributes;return{url:"".concat(e,"?").concat(d(r)),dataAttributes:o}}(t),o=r.url,i=r.dataAttributes;if(function(t,e){var n=document.querySelector('script[src="'.concat(t,'"]'));if(!n)return null;var r=p(t,e);if(v(n.dataset)!==v(r.dataset))return null;var o=!0;return h(n.dataset,(function(t){n.dataset[t]!==r.dataset[t]&&(o=!1)})),o?n:null}(o,i)&&window.paypal)return e(window.paypal);y=!0,function(t){var e=t.url,n=t.dataAttributes,r=t.onSuccess,o=t.onError,i=p(e,n);i.onerror=o,i.onload=r,document.head.insertBefore(i,document.head.firstElementChild)}({url:o,dataAttributes:i,onSuccess:function(){return y=!1,window.paypal?e(window.paypal):n(new Error("The window.paypal global variable is not available."))},onError:function(){return y=!1,n(new Error('The script "'.concat(o,"\" didn't load correctly.")))}})}))}return t.loadScript=function(t){return w(t,i)},t.version="2.0.0",Object.defineProperty(t,"__esModule",{value:!0}),t}({});paypalLoadScript=paypalLoadScript.loadScript; | ||
var paypalLoadScript=function(t){"use strict";var e,n=setTimeout;function r(t){return Boolean(t&&void 0!==t.length)}function o(){}function i(t){if(!(this instanceof i))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=[],s(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._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 c(e.promise,t)}u(e.promise,r)}else(1===t._state?u:c)(e.promise,t._value)}))):t._deferreds.push(e)}function u(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 i)return t._state=3,t._value=e,void f(t);if("function"==typeof n)return void s((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,f(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,f(t)}function f(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}function d(t){var e="";return h(t,(function(n){0!==e.length&&(e+="&"),e+=n+"="+t[n]})),e}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=document.createElement("script");return n.src=t,h(e,(function(t){n.setAttribute(t,e[t])})),n}function h(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n)}function v(t){var e=0;return h(t,(function(){return e++})),e}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new l(t,e,n)),n},i.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)}))}))},i.all=function(t){return new i((function(e,n){if(!r(t))return n(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,r){try{if(r&&("object"==typeof r||"function"==typeof r)){var u=r.then;if("function"==typeof u)return void u.call(r,(function(e){a(t,e)}),n)}o[t]=r,0==--i&&e(o)}catch(t){n(t)}}for(var u=0;u<o.length;u++)a(u,o[u])}))},i.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])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){if(!r(t))return n(new TypeError("Promise.race accepts an array"));for(var o=0,a=t.length;o<a;o++)i.resolve(t[o]).then(e,n)}))},i._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var y=!1;function w(t,n){if(!(t instanceof Object))throw new Error("Invalid arguments. Expected an object to be passed into loadScript().");if(void 0===n){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.");n=Promise}return y?e:e=new n((function(e,n){if("undefined"==typeof window)return e(null);var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);var n={queryParams:{},dataAttributes:{}};h(t,(function(e){"data-"===e.substring(0,5)?n.dataAttributes[e]=t[e]:n.queryParams[e]=t[e]}));var r=n.queryParams,o=n.dataAttributes;return{url:"".concat(e,"?").concat(d(r)),dataAttributes:o}}(t),o=r.url,i=r.dataAttributes;if(function(t,e){var n=document.querySelector('script[src="'.concat(t,'"]'));if(!n)return null;var r=p(t,e);if(v(n.dataset)!==v(r.dataset))return null;var o=!0;return h(n.dataset,(function(t){n.dataset[t]!==r.dataset[t]&&(o=!1)})),o?n:null}(o,i)&&window.paypal)return e(window.paypal);y=!0,function(t){var e=t.url,n=t.dataAttributes,r=t.onSuccess,o=t.onError,i=p(e,n);i.onerror=o,i.onload=r,document.head.insertBefore(i,document.head.firstElementChild)}({url:o,dataAttributes:i,onSuccess:function(){return y=!1,window.paypal?e(window.paypal):n(new Error("The window.paypal global variable is not available."))},onError:function(){return y=!1,n(new Error('The script "'.concat(o,"\" didn't load correctly.")))}})}))}return t.loadScript=function(t){return w(t,i)},t.version="2.0.2",Object.defineProperty(t,"__esModule",{value:!0}),t}({});paypalLoadScript=paypalLoadScript.loadScript; |
/*! | ||
* paypal-js v2.0.0 (2020-12-08T21:52:42.968Z) | ||
* paypal-js v2.0.2 (2020-12-08T22:07:33.198Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -157,5 +157,5 @@ * | ||
var version = '2.0.0'; | ||
var version = '2.0.2'; | ||
exports.loadScript = loadScript; | ||
exports.version = version; |
{ | ||
"name": "@paypal/paypal-js", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Client-side loader for the PayPal JS SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/paypal.node.js", |
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