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

configchecker

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

configchecker - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

2

lib/classes/ConfigValue.d.ts

@@ -9,3 +9,3 @@ import { IConfigValueProfile } from '../interfaces/IConfigValueProfile';

required(): ConfigValue<NonNullable<TValue>>;
default(value: NonNullable<TValue>): ConfigValue<NonNullable<TValue>>;
default(defaultValue: NonNullable<TValue>): ConfigValue<NonNullable<TValue>>;
custom<TvalueCustom>(conversionType: string, convert: (value: NonNullable<TValue>) => TvalueCustom): ConfigValue<TvalueCustom | undefined>;

@@ -12,0 +12,0 @@ readonly object: {

@@ -24,3 +24,3 @@ "use strict";

this.checkThatValueCanBeUndefinedToPreventMultipleUsageOfRequiredOrDefault();
if (typeof this.value === 'undefined') {
if (this.value === undefined) {
throw Error("In config should be defined " + this.profile.key + ". \n " + this.about);

@@ -30,6 +30,13 @@ }

};
ConfigValue.prototype.default = function (value) {
ConfigValue.prototype.default = function (defaultValue) {
this.checkThatValueCanBeUndefinedToPreventMultipleUsageOfRequiredOrDefault();
// TODO: ... it is saying on next line: "Type 'ConfigValue<T>' is not assignable to type 'ConfigValue<NonNullable<T>>'. Type 'T' is not assignable to type 'NonNullable<T>':
return new ConfigValue(this.value || value, this.profile, false);
var value;
if (this.value !== undefined) {
value = this.value;
}
else {
value = defaultValue;
}
return new ConfigValue(value, this.profile, false);
};

@@ -36,0 +43,0 @@ ConfigValue.prototype.custom = function (conversionType, convert) {

{
"name": "configchecker",
"version": "1.2.0",
"version": "1.3.0",
"description": "Awesome checker of config - fully support typescript, fluent API,...",

@@ -5,0 +5,0 @@ "main": "lib/index.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