@paypal/sdk-client
Advanced tools
Comparing version
{ | ||
"name": "@paypal/sdk-client", | ||
"version": "4.0.171", | ||
"version": "4.0.172", | ||
"description": "Shared config between PayPal/Braintree.", | ||
@@ -78,4 +78,4 @@ "main": "index.js", | ||
"lint-staged": "^13.0.3", | ||
"mocha": "^4.1.0", | ||
"prettier": "2.7.1" | ||
"mocha": "^10.0.0", | ||
"prettier": "2.8.8" | ||
}, | ||
@@ -82,0 +82,0 @@ "lint-staged": { |
@@ -68,4 +68,19 @@ /* @flow */ | ||
export function getVenmoDomainRegex(): RegExp { | ||
if (__ENV__ === ENV.LOCAL) { | ||
return /.*loca.*/; | ||
} | ||
// eslint-disable-next-line security/detect-unsafe-regex | ||
return /^([\w]*\.)*(venmo\.com)(:\d+)?$/; | ||
} | ||
export function isPayPalDomain(): boolean { | ||
return Boolean(getDomain().match(getPayPalDomainRegex())); | ||
} | ||
export function isPayPalTrustedDomain(): boolean { | ||
return ( | ||
Boolean(getDomain().match(getPayPalDomainRegex())) || | ||
Boolean(getDomain().match(getVenmoDomainRegex())) | ||
); | ||
} |
80988
0.49%1933
0.68%