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.21.1 to 0.21.2

44

dist/moneybutton.config.cjs.js

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

'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
{
"name": "@moneybutton/config",
"version": "0.21.1",
"version": "0.21.2",
"description": "Money Button configuration.",

@@ -5,0 +5,0 @@ "main": "dist/moneybutton.config.cjs.js",

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