@stripe/stripe-js
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -14,2 +14,13 @@ var V3_URL = 'https://js.stripe.com/v3'; | ||
return script; | ||
}; | ||
var registerWrapper = function registerWrapper(stripe) { | ||
if (!stripe || !stripe._registerWrapper) { | ||
return; | ||
} | ||
stripe._registerWrapper({ | ||
name: 'stripe-js', | ||
version: "1.3.1" | ||
}); | ||
}; // Execute our own script injection after a tick to give users time to | ||
@@ -55,3 +66,9 @@ // do their own script injection. | ||
return stripePromise.then(function (maybeStripe) { | ||
return maybeStripe ? maybeStripe.apply(void 0, args) : null; | ||
if (maybeStripe === null) { | ||
return null; | ||
} | ||
var stripe = maybeStripe.apply(void 0, args); | ||
registerWrapper(stripe); | ||
return stripe; | ||
}); | ||
@@ -58,0 +75,0 @@ }; |
@@ -18,2 +18,13 @@ 'use strict'; | ||
return script; | ||
}; | ||
var registerWrapper = function registerWrapper(stripe) { | ||
if (!stripe || !stripe._registerWrapper) { | ||
return; | ||
} | ||
stripe._registerWrapper({ | ||
name: 'stripe-js', | ||
version: "1.3.1" | ||
}); | ||
}; // Execute our own script injection after a tick to give users time to | ||
@@ -59,3 +70,9 @@ // do their own script injection. | ||
return stripePromise.then(function (maybeStripe) { | ||
return maybeStripe ? maybeStripe.apply(void 0, args) : null; | ||
if (maybeStripe === null) { | ||
return null; | ||
} | ||
var stripe = maybeStripe.apply(void 0, args); | ||
registerWrapper(stripe); | ||
return stripe; | ||
}); | ||
@@ -62,0 +79,0 @@ }; |
{ | ||
"name": "@stripe/stripe-js", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Stripe.js loading utility", | ||
@@ -38,2 +38,3 @@ "main": "dist/stripe.js", | ||
"@babel/preset-env": "^7.7.1", | ||
"@rollup/plugin-replace": "^2.3.1", | ||
"@types/jest": "^24.0.25", | ||
@@ -40,0 +41,0 @@ "@typescript-eslint/eslint-plugin": "^2.15.0", |
@@ -5,2 +5,6 @@ // eslint-disable-next-line @typescript-eslint/triple-slash-reference | ||
// `_VERSION` will be rewritten by `@rollup/plugin-replace` as a string literal | ||
// containing the package.json version | ||
declare const _VERSION: string; | ||
const V3_URL = 'https://js.stripe.com/v3'; | ||
@@ -25,2 +29,10 @@ | ||
const registerWrapper = (stripe: any): void => { | ||
if (!stripe || !stripe._registerWrapper) { | ||
return; | ||
} | ||
stripe._registerWrapper({name: 'stripe-js', version: _VERSION}); | ||
}; | ||
// Execute our own script injection after a tick to give users time to | ||
@@ -72,5 +84,11 @@ // do their own script injection. | ||
return stripePromise.then((maybeStripe) => | ||
maybeStripe ? maybeStripe(...args) : null | ||
); | ||
return stripePromise.then((maybeStripe) => { | ||
if (maybeStripe === null) { | ||
return null; | ||
} | ||
const stripe = maybeStripe(...args); | ||
registerWrapper(stripe); | ||
return stripe; | ||
}); | ||
}; |
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
173436
4342
22