@paypal/paypal-js
Advanced tools
Comparing version 2.1.0-beta.9 to 2.1.0
/*! | ||
* paypal-js v2.1.0-beta.8 (2021-01-03T18:28:37.531Z) | ||
* paypal-js v2.1.0 (2021-01-03T22:38:59.809Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -153,3 +153,3 @@ * | ||
var version = '2.1.0-beta.8'; | ||
var version = '2.1.0'; | ||
@@ -156,0 +156,0 @@ exports.loadScript = loadScript; |
/*! | ||
* paypal-js v2.1.0-beta.8 (2021-01-03T18:28:37.531Z) | ||
* paypal-js v2.1.0 (2021-01-03T22:38:59.809Z) | ||
* 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(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);var n={queryParams:{},dataAttributes:{}};a(t,(function(r){var e="data-"===r.substring(0,5)?"dataAttributes":"queryParams";n[e][r]=t[r].toString()}));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(null===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.1.0-beta.8",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(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL);var n={queryParams:{},dataAttributes:{}};a(t,(function(r){var e="data-"===r.substring(0,5)?"dataAttributes":"queryParams";n[e][r]=t[r].toString()}));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(null===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.1.0",Object.defineProperty(t,"__esModule",{value:!0}),t}({});paypalLoadScript=paypalLoadScript.loadScript; |
/*! | ||
* paypal-js v2.1.0-beta.8 (2021-01-03T18:28:37.531Z) | ||
* paypal-js v2.1.0 (2021-01-03T22:38:59.809Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -150,4 +150,4 @@ * | ||
var version = '2.1.0-beta.8'; | ||
var version = '2.1.0'; | ||
export { loadScript, version }; |
/*! | ||
* paypal-js v2.1.0-beta.8 (2021-01-03T18:28:37.531Z) | ||
* paypal-js v2.1.0 (2021-01-03T22:38:59.809Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -463,3 +463,3 @@ * | ||
// replaced with the package.json version at build time | ||
const version = '2.1.0-beta.8'; | ||
const version = '2.1.0'; | ||
@@ -466,0 +466,0 @@ exports.loadScript = loadScript$1; |
/*! | ||
* paypal-js v2.1.0-beta.8 (2021-01-03T18:28:37.531Z) | ||
* paypal-js v2.1.0 (2021-01-03T22:38:59.809Z) | ||
* 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])})),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.0-beta.8",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])})),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.0",Object.defineProperty(t,"__esModule",{value:!0}),t}({});paypalLoadScript=paypalLoadScript.loadScript; |
/*! | ||
* paypal-js v2.1.0-beta.8 (2021-01-03T18:28:37.531Z) | ||
* paypal-js v2.1.0 (2021-01-03T22:38:59.809Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -154,5 +154,5 @@ * | ||
var version = '2.1.0-beta.8'; | ||
var version = '2.1.0'; | ||
exports.loadScript = loadScript; | ||
exports.version = version; |
{ | ||
"name": "@paypal/paypal-js", | ||
"version": "2.1.0-beta.9", | ||
"version": "2.1.0", | ||
"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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
70202