New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@drizzle-team/brocli

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@drizzle-team/brocli - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

6

index.d.ts

@@ -25,3 +25,3 @@ /**

};
declare class OptionBuilderBase<TBuilderConfig extends BuilderConfig = BuilderConfig, TOutput extends OutputType = string, TOmit extends string = '', TDefault extends OutputType = undefined> {
declare class OptionBuilderBase<TBuilderConfig extends BuilderConfig = BuilderConfig, TOutput extends OutputType = string, TOmit extends string = '', TEnums extends string | undefined = undefined> {
_: {

@@ -49,4 +49,4 @@ config: TBuilderConfig;

required(): Omit<OptionBuilderBase<BuilderConfig, Exclude<TOutput, undefined>, TOmit | 'required' | 'default'>, TOmit | 'required' | 'default'>;
default<TDefVal extends TOutput extends string ? string : Exclude<TOutput, undefined>>(value: TDefVal): Omit<OptionBuilderBase<BuilderConfig, Exclude<TOutput | TDefVal, undefined>, TOmit | 'required' | 'default'>, TOmit | 'required' | 'default'>;
enum<TValues extends [string, ...string[]]>(...values: TValues): Omit<OptionBuilderBase<BuilderConfig, Exclude<TOutput | TDefault, string> | TValues[number], TOmit | 'enum'>, TOmit | 'enum'>;
default<TDefVal extends TEnums extends undefined ? Exclude<TOutput, undefined> : TEnums>(value: TDefVal): Omit<OptionBuilderBase<BuilderConfig, Exclude<TOutput, undefined>, TOmit | 'enum' | 'required' | 'default', TEnums>, TOmit | 'enum' | 'required' | 'default'>;
enum<TValues extends [string, ...string[]]>(...values: TValues): Omit<OptionBuilderBase<BuilderConfig, TValues[number], TOmit | 'enum', TValues[number]>, TOmit | 'enum'>;
min(value: number): Omit<OptionBuilderBase<BuilderConfig, TOutput, TOmit | 'min'>, TOmit | 'min'>;

@@ -53,0 +53,0 @@ max(value: number): Omit<OptionBuilderBase<BuilderConfig, TOutput, TOmit | 'max'>, TOmit | 'max'>;

@@ -61,2 +61,8 @@ // src/brocli-error.ts

default(value) {
const enums = this.config().enumVals;
if (enums && !enums.find((v) => value === v)) {
throw new Error(
`Option enums [ ${enums.join(", ")} ] are incompatible with default value ${value}`
);
}
this.config().default = value;

@@ -66,2 +72,8 @@ return this;

enum(...values) {
const defaultVal = this.config().default;
if (defaultVal !== void 0 && !values.find((v) => defaultVal === v)) {
throw new Error(
`Option enums [ ${values.join(", ")} ] are incompatible with default value ${defaultVal}`
);
}
this.config().enumVals = values;

@@ -68,0 +80,0 @@ return this;

@@ -5,3 +5,3 @@ {

"author": "Drizzle Team",
"version": "0.2.3",
"version": "0.2.4",
"description": "Typed CLI command runner",

@@ -8,0 +8,0 @@ "license": "Apache-2.0",

@@ -71,3 +71,2 @@ # BroCLI

- `values` - allowed enum values
:warning: - does not test default value, will add it to the output type instead

@@ -74,0 +73,0 @@ - `.int()` - ensures that number is an integer

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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