Socket
Socket
Sign inDemoInstall

braintree-paypal-client-config

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

2

dist/braintree-paypal-client-config.js
!function(root, factory) {
"object" == typeof exports && "object" == typeof module ? module.exports = factory() : "function" == typeof define && define.amd ? define("btppClientConfig", [], factory) : "object" == typeof exports ? exports.btppClientConfig = factory() : root.btppClientConfig = factory();
}(this, function() {
}("undefined" != typeof self ? self : this, function() {
return function(modules) {

@@ -5,0 +5,0 @@ function __webpack_require__(moduleId) {

@@ -1,3 +0,3 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("btppClientConfig",[],n):"object"==typeof exports?exports.btppClientConfig=n():t.btppClientConfig=n()}(this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var e={};return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s="./src/index.js")}({"./src/config.js":function(t,n,e){"use strict";function r(t,n){return u.a.has(t)?u.a.get(t):n}function o(t,n){if(u.a.set(t,n),a[t])for(var e=a[t],r=Array.isArray(e),o=0,e=r?e:e[Symbol.iterator]();;){var s;if(r){if(o>=e.length)break;s=e[o++]}else{if(o=e.next(),o.done)break;s=o.value}var i=s;i(n)}return n}function s(t,n){return u.a.has(t)?r(t):o(t,n)}function i(t,n){return a[t]=a[t]||[],a[t].push(n),{cancel:function(){a[t].splice(a[t].indexOf(n),1)}}}n.a=r,n.d=o,n.b=s,n.c=i;var u=e("./src/store.js"),a={}},"./src/constants.js":function(t,n,e){"use strict";e.d(n,"a",function(){return r}),e.d(n,"d",function(){return o}),e.d(n,"b",function(){return s}),e.d(n,"c",function(){return i});var r="__braintree_paypal_config__",o={SESSIONSTORAGE:"sessionstorage",GLOBAL:"global"},s={LOGGER_SESSION_ID:"logger_session_id",PAYPAL_FUNDING_DISALLOW:"paypal_funding_disallow"},i={PAYPAL:"paypal",VENMO:"venmo",CREDIT:"credit",CARD:"card",IDEAL:"ideal",ELV:"elv"}},"./src/index.js":function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./src/config.js");e.d(n,"get",function(){return r.a}),e.d(n,"set",function(){return r.d}),e.d(n,"get_or_set",function(){return r.b}),e.d(n,"on",function(){return r.c});var o=e("./src/constants.js");e.d(n,"CONFIG_KEY",function(){return o.a}),e.d(n,"STORE",function(){return o.d}),e.d(n,"KEY",function(){return o.b}),e.d(n,"PAYPAL_FUNDING",function(){return o.c})},"./src/store.js":function(t,n,e){"use strict";function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}e.d(n,"a",function(){return a});var o,s=e("./src/constants.js"),i=e("./src/util.js"),u=(o={},r(o,s.d.GLOBAL,{get:function(t){return(window[s.a]||{})[t]},set:function(t,n){var e=window[s.a]||{};return e[t]=n,window[s.a]=e,n},has:function(t){return(window[s.a]||{}).hasOwnProperty(t)}}),r(o,s.d.SESSIONSTORAGE,{get:function(t){var n=window.sessionStorage.getItem(s.a);return n=n?JSON.parse(n):{},n[t]},set:function(t,n){var e=window.sessionStorage.getItem(s.a);return e=e?JSON.parse(e):{},e[t]=n,window.sessionStorage.setItem(s.a,JSON.stringify(e)),n},has:function(t){var n=window.sessionStorage.getItem(s.a);return n=n?JSON.parse(n):{},n.hasOwnProperty(t)}}),o),a=Object(i.a)()?u[s.d.SESSIONSTORAGE]:u[s.d.GLOBAL]},"./src/util.js":function(t,n,e){"use strict";function r(){try{if(window.sessionStorage){var t=Math.random().toString();window.sessionStorage.setItem("__test__sessionStorage__",t);var n=window.sessionStorage.getItem("__test__sessionStorage__");if(window.sessionStorage.removeItem("__test__sessionStorage__"),t===n)return!0}}catch(t){}return!1}n.a=r}})});
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("btppClientConfig",[],t):"object"==typeof exports?exports.btppClientConfig=t():n.btppClientConfig=t()}("undefined"!=typeof self?self:this,function(){return function(n){function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e={};return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s="./src/index.js")}({"./src/config.js":function(n,t,e){"use strict";function r(n,t){return u.a.has(n)?u.a.get(n):t}function o(n,t){if(u.a.set(n,t),a[n])for(var e=a[n],r=Array.isArray(e),o=0,e=r?e:e[Symbol.iterator]();;){var s;if(r){if(o>=e.length)break;s=e[o++]}else{if(o=e.next(),o.done)break;s=o.value}var i=s;i(t)}return t}function s(n,t){return u.a.has(n)?r(n):o(n,t)}function i(n,t){return a[n]=a[n]||[],a[n].push(t),{cancel:function(){a[n].splice(a[n].indexOf(t),1)}}}t.a=r,t.d=o,t.b=s,t.c=i;var u=e("./src/store.js"),a={}},"./src/constants.js":function(n,t,e){"use strict";e.d(t,"a",function(){return r}),e.d(t,"d",function(){return o}),e.d(t,"b",function(){return s}),e.d(t,"c",function(){return i});var r="__braintree_paypal_config__",o={SESSIONSTORAGE:"sessionstorage",GLOBAL:"global"},s={LOGGER_SESSION_ID:"logger_session_id",PAYPAL_FUNDING_DISALLOW:"paypal_funding_disallow"},i={PAYPAL:"paypal",VENMO:"venmo",CREDIT:"credit",CARD:"card",IDEAL:"ideal",ELV:"elv"}},"./src/index.js":function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=e("./src/config.js");e.d(t,"get",function(){return r.a}),e.d(t,"set",function(){return r.d}),e.d(t,"get_or_set",function(){return r.b}),e.d(t,"on",function(){return r.c});var o=e("./src/constants.js");e.d(t,"CONFIG_KEY",function(){return o.a}),e.d(t,"STORE",function(){return o.d}),e.d(t,"KEY",function(){return o.b}),e.d(t,"PAYPAL_FUNDING",function(){return o.c})},"./src/store.js":function(n,t,e){"use strict";function r(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}e.d(t,"a",function(){return a});var o,s=e("./src/constants.js"),i=e("./src/util.js"),u=(o={},r(o,s.d.GLOBAL,{get:function(n){return(window[s.a]||{})[n]},set:function(n,t){var e=window[s.a]||{};return e[n]=t,window[s.a]=e,t},has:function(n){return(window[s.a]||{}).hasOwnProperty(n)}}),r(o,s.d.SESSIONSTORAGE,{get:function(n){var t=window.sessionStorage.getItem(s.a);return t=t?JSON.parse(t):{},t[n]},set:function(n,t){var e=window.sessionStorage.getItem(s.a);return e=e?JSON.parse(e):{},e[n]=t,window.sessionStorage.setItem(s.a,JSON.stringify(e)),t},has:function(n){var t=window.sessionStorage.getItem(s.a);return t=t?JSON.parse(t):{},t.hasOwnProperty(n)}}),o),a=Object(i.a)()?u[s.d.SESSIONSTORAGE]:u[s.d.GLOBAL]},"./src/util.js":function(n,t,e){"use strict";function r(){try{if(window.sessionStorage){var n=Math.random().toString();window.sessionStorage.setItem("__test__sessionStorage__",n);var t=window.sessionStorage.getItem("__test__sessionStorage__");if(window.sessionStorage.removeItem("__test__sessionStorage__"),n===t)return!0}}catch(n){}return!1}t.a=r}})});
//# sourceMappingURL=braintree-paypal-client-config.min.js.map
//# sourceMappingURL=braintree-paypal-client-config.min.js.map
{
"name": "braintree-paypal-client-config",
"version": "1.0.2",
"version": "1.0.3",
"description": "Shared config between PayPal/Braintree.",

@@ -23,3 +23,2 @@ "main": "index.js",

"reinstall": "rimraf flow-typed && rimraf node_modules && npm install && flow-typed install",
"postinstall": "flow-typed install",
"debug": "cross-env NODE_ENV=debug"

@@ -26,0 +25,0 @@ },

@@ -22,5 +22,5 @@ Braintree-PayPal Client Config

```
import { config, KEYS } from 'braintree-paypal-client-config';
import { set, KEYS } from 'braintree-paypal-client-config';
config.set(KEYS.ALLOW_FOO, true);
set(KEYS.ALLOW_FOO, true);
```

@@ -31,5 +31,5 @@

```
import { config, KEYS } from 'braintree-paypal-client-config';
import { get, KEYS } from 'braintree-paypal-client-config';
if (config.get(KEYS.ALLOW_FOO)) {
if (get(KEYS.ALLOW_FOO)) {
doFoo();

@@ -41,15 +41,15 @@ }

#### `config.get(<key>, [default])`
#### `get(<key>, [default])`
Get the current value for the given key, returns `undefined` if unset or `default` if specified
#### `config.set(<key>, <value>)`
#### `set(<key>, <value>)`
Set the value under the given key.
#### `config.get_or_set(<key>, <value>)`
#### `get_or_set(<key>, <value>)`
Gets the value if it is available, otherwise sets a new value.
#### `config.on(<key>, <handler>)`
#### `on(<key>, <handler>)`

@@ -66,3 +66,3 @@ Calls the `handler` every time the key is set. Good for reading configuration values which may change over time.

// Set a shared session id or get an existing session id
let sessionID = config.get_or_set(KEY.LOGGER_SESSION_ID, 'abcdef12345');
let sessionID = get_or_set(KEY.LOGGER_SESSION_ID, 'abcdef12345');
```

@@ -76,3 +76,3 @@

// Disallow paypal from rendering card (credit/debit) butttons
config.set(KEY.PAYPAL_FUNDING_DISALLOW, [ PAYPAL_FUNDING.CARD ]);
set(KEY.PAYPAL_FUNDING_DISALLOW, [ PAYPAL_FUNDING.CARD ]);
```

@@ -103,2 +103,2 @@

npm run test
```
```
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