Socket
Socket
Sign inDemoInstall

paypal-braintree-web-client

Package Overview
Dependencies
8
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.32 to 4.0.33

2

package.json
{
"name": "paypal-braintree-web-client",
"version": "4.0.32",
"version": "4.0.33",
"description": "Shared config between PayPal/Braintree.",

@@ -5,0 +5,0 @@ "main": "index.js",

/* @flow */
import { COUNTRY, LANG, ENV } from 'paypal-sdk-constants/src';
import { COUNTRY, ENV } from 'paypal-sdk-constants/src';

@@ -14,4 +14,2 @@ declare var __HOST__ : string;

declare var __LOCALE_COUNTRY__ : $Values<typeof COUNTRY>;
declare var __LOCALE_LANG__ : $Values<typeof LANG> | void;
declare var __DEFAULT_LANG__ : $Values<typeof LANG>;
declare var __DEBUG__ : boolean;

@@ -18,0 +16,0 @@ declare var __STAGE__ : boolean;

/* @flow */
import { getBrowserLocales } from 'belter/src';
import { type LocaleType, COUNTRY, LANG, ENV, COUNTRY_LANGS } from 'paypal-sdk-constants/src';
import { COUNTRY, ENV } from 'paypal-sdk-constants/src';

@@ -30,24 +29,2 @@ export function getHost() : string {

export function getLang() : $Values<typeof LANG> {
if (typeof __LOCALE_LANG__ !== 'undefined') {
return __LOCALE_LANG__;
}
for (const { country, lang } of getBrowserLocales()) {
if (country && country === __LOCALE_COUNTRY__ && COUNTRY_LANGS[__LOCALE_COUNTRY__].indexOf(lang) !== -1) {
// $FlowFixMe
return lang;
}
}
return __DEFAULT_LANG__;
}
export function getLocale() : LocaleType {
return {
lang: getLang(),
country: getCountry()
};
}
export function getDefaultStageHost() : string {

@@ -54,0 +31,0 @@ return __STAGE_HOST__;

@@ -9,4 +9,4 @@ /* @flow */

import { getPayPalLoggerUrl } from './config';
import { getEnv, getLang, getCountry, getVersion, getCorrelationID } from './globals';
import { getPartnerAttributionID, getClientID, getMerchantID, getCommit } from './script';
import { getEnv, getCountry, getVersion, getCorrelationID } from './globals';
import { getPartnerAttributionID, getClientID, getMerchantID, getCommit, getLang } from './script';
import { isEligible } from './eligibility';

@@ -13,0 +13,0 @@ import { getSessionID } from './session';

/* @flow */
import { getScript, inlineMemoize, parseQuery } from 'belter/src';
import { SDK_SETTINGS, SDK_QUERY_KEYS, INTENT, COMMIT, VAULT, CURRENCY,
DEFAULT_INTENT, DEFAULT_COMMIT, DEFAULT_CURRENCY, DEFAULT_VAULT, QUERY_BOOL } from 'paypal-sdk-constants/src';
import { getScript, inlineMemoize, parseQuery, getBrowserLocales } from 'belter/src';
import { SDK_SETTINGS, SDK_QUERY_KEYS, INTENT, COMMIT, VAULT, CURRENCY, COUNTRY_LANGS,
DEFAULT_INTENT, DEFAULT_COMMIT, DEFAULT_CURRENCY, DEFAULT_VAULT, QUERY_BOOL, LANG, type LocaleType } from 'paypal-sdk-constants/src';
import { getHost, getPath, getDefaultStageHost } from './globals';
import { getHost, getPath, getDefaultStageHost, getCountry } from './globals';

@@ -122,1 +122,28 @@ export const CLIENT_ID_ALIAS = {

}
export function getLang() : $Values<typeof LANG> {
const queryLang = getSDKQueryParam(SDK_QUERY_KEYS.LOCALE_LANG);
if (queryLang) {
return queryLang;
}
const queryCountry = getCountry();
const potentialLangs = COUNTRY_LANGS[queryCountry];
for (const { country, lang } of getBrowserLocales()) {
if (country && country === queryCountry && potentialLangs.indexOf(lang) !== -1) {
// $FlowFixMe
return lang;
}
}
return potentialLangs[0];
}
export function getLocale() : LocaleType {
return {
lang: getLang(),
country: getCountry()
};
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc