Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@moneybutton/config

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@moneybutton/config - npm Package Compare versions

Comparing version 0.1.8 to 0.21.1

dist/mb-config.cjs.js

44

dist/moneybutton.config.cjs.js

@@ -1,53 +0,51 @@

'use strict';
'use strict'
class Config {
constructor(values) {
this.keyDefined = key => key in values;
constructor (values) {
this.keyDefined = key => key in values
this.getValue = key => values[key];
this.getValue = key => values[key]
}
get(key) {
get (key) {
if (this.keyDefined(key)) {
return this.getValue(key);
return this.getValue(key)
} else {
throw new Error(`Unknown configuration: ${key}`);
throw new Error(`Unknown configuration: ${key}`)
}
}
}
class MoneyButtonConfigBuilder {
constructor() {
this.variables = {};
constructor () {
this.variables = {}
}
build() {
return new Config(this.variables);
build () {
return new Config(this.variables)
}
addValue(key, value) {
addValue (key, value) {
if (value === undefined) {
throw new Error(`Failed to add "${key}" property. The value cannot be undefined`);
throw new Error(`Failed to add "${key}" property. The value cannot be undefined`)
}
if (key in this.variables) {
throw new Error(`"${key}" already has a value defined.`);
throw new Error(`"${key}" already has a value defined.`)
}
this.variables[key] = value;
return this;
this.variables[key] = value
return this
}
addValueWithDefault(key, value, defaultValue) {
addValueWithDefault (key, value, defaultValue) {
if (defaultValue === undefined) {
throw new Error(`Failed to add "${key}" property. Default value cannot be undefined`);
throw new Error(`Failed to add "${key}" property. Default value cannot be undefined`)
}
return this.addValue(key, value === undefined ? defaultValue : value);
return this.addValue(key, value === undefined ? defaultValue : value)
}
}
module.exports = MoneyButtonConfigBuilder;
//# sourceMappingURL=moneybutton.config.cjs.js.map
module.exports = MoneyButtonConfigBuilder
// # sourceMappingURL=moneybutton.config.cjs.js.map
class Config {
constructor(values) {
this.keyDefined = key => key in values;
constructor (values) {
this.keyDefined = key => key in values
this.getValue = key => values[key];
this.getValue = key => values[key]
}
get(key) {
get (key) {
if (this.keyDefined(key)) {
return this.getValue(key);
return this.getValue(key)
} else {
throw new Error(`Unknown configuration: ${key}`);
throw new Error(`Unknown configuration: ${key}`)
}
}
}
class MoneyButtonConfigBuilder {
constructor() {
this.variables = {};
constructor () {
this.variables = {}
}
build() {
return new Config(this.variables);
build () {
return new Config(this.variables)
}
addValue(key, value) {
addValue (key, value) {
if (value === undefined) {
throw new Error(`Failed to add "${key}" property. The value cannot be undefined`);
throw new Error(`Failed to add "${key}" property. The value cannot be undefined`)
}
if (key in this.variables) {
throw new Error(`"${key}" already has a value defined.`);
throw new Error(`"${key}" already has a value defined.`)
}
this.variables[key] = value;
return this;
this.variables[key] = value
return this
}
addValueWithDefault(key, value, defaultValue) {
addValueWithDefault (key, value, defaultValue) {
if (defaultValue === undefined) {
throw new Error(`Failed to add "${key}" property. Default value cannot be undefined`);
throw new Error(`Failed to add "${key}" property. Default value cannot be undefined`)
}
return this.addValue(key, value === undefined ? defaultValue : value);
return this.addValue(key, value === undefined ? defaultValue : value)
}
}
export default MoneyButtonConfigBuilder;
//# sourceMappingURL=moneybutton.esm.js.map
export default MoneyButtonConfigBuilder
// # sourceMappingURL=moneybutton.esm.js.map

@@ -20,3 +20,3 @@ /**

* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/var MoneyButtonConfigBuilder=function(){"use strict";function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}var b=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},c=function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b},d=function(){function a(c){b(this,a),this.keyDefined=function(a){return a in c},this.getValue=function(a){return c[a]}}return c(a,[{key:"get",value:function(a){if(this.keyDefined(a))return this.getValue(a);throw new Error("Unknown configuration: ".concat(a))}}]),a}(),e=function(){function a(){b(this,a),this.variables={}}return c(a,[{key:"build",value:function(){return new d(this.variables)}},{key:"addValue",value:function(a,b){if(void 0===b)throw new Error("Failed to add \"".concat(a,"\" property. The value cannot be undefined"));if(a in this.variables)throw new Error("\"".concat(a,"\" already has a value defined."));return this.variables[a]=b,this}},{key:"addValueWithDefault",value:function(a,b,c){if(void 0===c)throw new Error("Failed to add \"".concat(a,"\" property. Default value cannot be undefined"));return this.addValue(a,void 0===b?c:b)}}]),a}();return e}();
//# sourceMappingURL=moneybutton.iife.js.map
*/var MoneyButtonConfigBuilder = (function () { 'use strict'; function a (a, b) { for (var c, d = 0; d < b.length; d++)c = b[d], c.enumerable = c.enumerable || !1, c.configurable = !0, 'value' in c && (c.writable = !0), Object.defineProperty(a, c.key, c) } var b = function (a, b) { if (!(a instanceof b)) throw new TypeError('Cannot call a class as a function') }; var c = function (b, c, d) { return c && a(b.prototype, c), d && a(b, d), b }; var d = (function () { function a (c) { b(this, a), this.keyDefined = function (a) { return a in c }, this.getValue = function (a) { return c[a] } } return c(a, [{ key: 'get', value: function (a) { if (this.keyDefined(a)) return this.getValue(a); throw new Error('Unknown configuration: '.concat(a)) } }]), a }()); var e = (function () { function a () { b(this, a), this.variables = {} } return c(a, [{ key: 'build', value: function () { return new d(this.variables) } }, { key: 'addValue', value: function (a, b) { if (void 0 === b) throw new Error('Failed to add "'.concat(a, '" property. The value cannot be undefined')); if (a in this.variables) throw new Error('"'.concat(a, '" already has a value defined.')); return this.variables[a] = b, this } }, { key: 'addValueWithDefault', value: function (a, b, c) { if (void 0 === c) throw new Error('Failed to add "'.concat(a, '" property. Default value cannot be undefined')); return this.addValue(a, void 0 === b ? c : b) } }]), a }()); return e }())
// # sourceMappingURL=moneybutton.iife.js.map
{
"name": "@moneybutton/config",
"version": "0.1.8",
"version": "0.21.1",
"description": "Money Button configuration.",

@@ -57,3 +57,3 @@ "main": "dist/moneybutton.config.cjs.js",

"should": "13.2.1",
"standard": "11.0.1"
"standard": "12.0.1"
},

@@ -70,3 +70,4 @@ "standard": {

]
}
},
"gitHead": "1140693bf8eb445920deeb5d0c76e6e5ba341876"
}

@@ -23,3 +23,3 @@ # @moneybutton/config

[Money Button](https://www.moneybutton.com) is a UI/UX and API layer for the blockchain which takes 0% transaction fees and makes Bitcoin Cash easy for everyone, everywhere.
[Money Button](https://www.moneybutton.com) is a UI/UX and API layer for the blockchain which takes 0% transaction fees and makes Bitcoin SV easy for everyone, everywhere.

@@ -26,0 +26,0 @@ ## Install

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc