You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP →

@effect/cli

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect/cli - npm Package Compare versions

Comparing version

to
0.2.0

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

});
exports.zipWith = exports.zipFlatten = exports.zip = exports.withDescription = exports.withDefault = exports.validate = exports.usage = exports.uid = exports.text = exports.orElseEither = exports.orElse = exports.optional = exports.none = exports.mapTryCatch = exports.mapOrFail = exports.map = exports.keyValueMapFromOption = exports.keyValueMap = exports.isOptions = exports.isBool = exports.integer = exports.helpDoc = exports.float = exports.filterMap = exports.date = exports.choice = exports.boolean = exports.all = exports.alias = exports.OptionsTypeId = void 0;
exports.zipWith = exports.zipFlatten = exports.zip = exports.withDescription = exports.withDefault = exports.validate = exports.usage = exports.uid = exports.text = exports.repeat1 = exports.repeat = exports.orElseEither = exports.orElse = exports.optional = exports.none = exports.mapTryCatch = exports.mapOrFail = exports.map = exports.keyValueMapFromOption = exports.keyValueMap = exports.isOptions = exports.isBool = exports.integer = exports.helpDoc = exports.float = exports.filterMap = exports.date = exports.choice = exports.boolean = exports.between = exports.atMost = exports.atLeast = exports.all = exports.alias = exports.OptionsTypeId = void 0;
var autoCorrect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/cli/internal_effect_untraced/autoCorrect"));

@@ -47,3 +47,12 @@ var doc = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/cli/internal_effect_untraced/helpDoc"));

}));
/** @internal */
exports.alias = alias;
const atLeast = /*#__PURE__*/(0, _Function.dual)(2, (self, times) => variadic(self, Option.some(times), Option.none()));
/** @internal */
exports.atLeast = atLeast;
const atMost = /*#__PURE__*/(0, _Function.dual)(2, (self, times) => variadic(self, Option.none(), Option.some(times)));
/** @internal */
exports.atMost = atMost;
const between = /*#__PURE__*/(0, _Function.dual)(3, (self, min, max) => variadic(self, Option.some(min), Option.some(max)));
exports.between = between;
const defaultBooleanOptions = {

@@ -92,5 +101,6 @@ ifPresent: true,

KeyValueMap: self => helpDocMap[self.argumentOption._tag](self.argumentOption),
Variadic: self => helpDocMap[self.options._tag](self.options),
WithDefault: self => {
const helpDoc = helpDocMap[self.options._tag](self.options);
return doc.mapDescriptionList(helpDoc, (span, block) => [span, doc.sequence(block, doc.p(`This setting is optional. (Defaults to: '${JSON.stringify(self.default)}')`))]);
return doc.mapDescriptionList(helpDoc, (span, block) => [span, doc.sequence(block, doc.p(Option.isOption(self.default) ? "This setting is optional." : `This setting is optional. (Defaults to: '${JSON.stringify(self.default)}')`))]);
},

@@ -115,2 +125,3 @@ Zip: self => {

KeyValueMap: () => false,
Variadic: () => false,
WithDefault: self => isBoolMap[self.options._tag](self.options),

@@ -191,2 +202,8 @@ Zip: () => false

exports.orElseEither = orElseEither;
const repeat = self => variadic(self, Option.none(), Option.none());
/** @internal */
exports.repeat = repeat;
const repeat1 = self => variadic(self, Option.some(1), Option.none());
/** @internal */
exports.repeat1 = repeat1;
const text = name => single(name, Chunk.empty(), primitive.text);

@@ -200,2 +217,3 @@ exports.text = text;

KeyValueMap: self => uidMap[self.argumentOption._tag](self.argumentOption),
Variadic: self => uidMap[self.options._tag](self.options),
WithDefault: self => uidMap[self.options._tag](self.options),

@@ -221,2 +239,3 @@ Zip: self => combineUids(self.left, self.right)

KeyValueMap: self => usageMap[self.argumentOption._tag](self.argumentOption),
Variadic: self => _usage.optional(usageMap[self.options._tag](self.options)),
WithDefault: self => _usage.optional(usageMap[self.options._tag](self.options)),

@@ -276,2 +295,21 @@ Zip: self => {

KeyValueMap: (self, args, config) => Effect.map(validateMap[self.argumentOption._tag](self.argumentOption, args, config), tuple => processKeyValueMapArg(self, tuple[0], tuple[1], config)),
Variadic: (self, args, config) => {
const min = Option.getOrElse(self.min, () => 0);
const max = Option.getOrElse(self.max, () => Infinity);
const loop = (args, acc) => Effect.matchEffect(validateMap[self.options._tag](self.options, args, config), error => {
if (!validationError.isMissingValue(error)) {
return Effect.fail(error);
} else if (acc.length < min) {
return Effect.fail(validationError.missingValue(doc.p(span.error(`Expected at least ${min} value(s) for option: '${singleFullName(self.options)}'`))));
}
return Effect.succeed([args, acc]);
}, tuple => {
acc = Chunk.append(acc, tuple[1]);
if (acc.length > max) {
return Effect.fail(validationError.extraneousValue(doc.p(span.error(`Expected at most ${max} value(s) for option: '${singleFullName(self.options)}'`))));
}
return loop(tuple[0], acc);
});
return loop(args, Chunk.empty());
},
WithDefault: (self, args, config) => Effect.catchSome(validateMap[self.options._tag](self.options, args, config), error => validationError.isMissingValue(error) ? Option.some(Effect.succeed([args, self.default])) : Option.none()),

@@ -282,4 +320,12 @@ Zip: (self, args, config) => Effect.flatMap(([args, a]) => Effect.map(([args, b]) => [args, [a, b]])(validateMap[self.right._tag](self.right, args, config)))(Effect.catchAll(error1 => Effect.matchEffect(validateMap[self.right._tag](self.right, args, config), error2 => Effect.fail(validationError.missingValue(doc.sequence(error1.error, error2.error))), () => Effect.fail(error1)))(validateMap[self.left._tag](self.left, args, config)))

const validate = /*#__PURE__*/Debug.dualWithTrace(3, trace => (self, args, config) => validateMap[self._tag](self, args, config).traced(trace));
exports.validate = validate;
const variadic = (self, min, max) => {
const op = Object.create(proto);
op._tag = "Variadic";
op.options = self;
op.min = min;
op.max = max;
return op;
};
/** @internal */
exports.validate = validate;
const withDefault = /*#__PURE__*/(0, _Function.dual)(2, (self, value) => {

@@ -362,2 +408,3 @@ const op = Object.create(proto);

KeyValueMap: (self, f) => keyValueMapFromOption(f(self.argumentOption)),
Variadic: (self, f) => variadic(f(self.options), self.min, self.max),
WithDefault: (self, f) => withDefault(modifySingle(self.options, f), self.default),

@@ -371,14 +418,21 @@ Zip: (self, f) => zip(modifySingle(self.left, f), modifySingle(self.right, f))

const processKeyValueMapArg = (self, input, first, config) => {
const [remaining, chunk] = processVariadicArg(repeat(self.argumentOption), input, first, config);
const createMapEntry = input => input.split("=").slice(0, 2);
return [remaining, HashMap.fromIterable(Chunk.map(chunk, createMapEntry))];
};
const processVariadicArg = (self, input, first, config) => {
const max = Option.getOrElse(self.max, () => Infinity);
const makeFullName = s => s.length === 1 ? `-${s}` : `--${s}`;
const supports = (s, config) => {
const argumentNames = Chunk.prepend(Chunk.map(self.argumentOption.aliases, makeFullName), makeFullName(self.argumentOption.name));
const argumentNames = Chunk.prepend(Chunk.map(self.options.aliases, makeFullName), makeFullName(self.options.name));
return config.isCaseSensitive ? Chunk.elem(argumentNames, s) : Chunk.some(argumentNames, name => name.toLowerCase() === s.toLowerCase());
};
const createMapEntry = input => input.split("=").slice(0, 2);
const createMap = input => HashMap.fromIterable(RA.map(RA.filter(input, s => !s.startsWith("-")), createMapEntry));
const createChunk = input => Chunk.fromIterable(RA.filter(input, s => !s.startsWith("-")));
const tuple = RA.span(RA.fromIterable(input), s => !s.startsWith("-") || supports(s, config));
const remaining = tuple[1];
const firstEntry = createMapEntry(first);
const map = HashMap.set(createMap(tuple[0]), firstEntry[0], firstEntry[1]);
return [remaining, map];
let chunk = Chunk.prepend(createChunk(tuple[0]), first);
if (max < Infinity) {
chunk = Chunk.take(chunk, max);
}
return [remaining, chunk];
};

@@ -385,0 +439,0 @@ const processSingleArg = (self, arg, remaining, config) => {

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

});
exports.missingValue = exports.missingSubCommand = exports.make = exports.isValidationError = exports.isMissingValue = exports.isMissingSubCommand = exports.isInvalidValue = exports.isInvalidArgument = exports.isCommandMismatch = exports.invalidValue = exports.invalidArgument = exports.commandMismatch = exports.ValidationErrorTypeId = void 0;
exports.missingValue = exports.missingSubCommand = exports.make = exports.isValidationError = exports.isMissingValue = exports.isMissingSubCommand = exports.isInvalidValue = exports.isInvalidArgument = exports.isExtraneousValue = exports.isCommandMismatch = exports.invalidValue = exports.invalidArgument = exports.extraneousValue = exports.commandMismatch = exports.ValidationErrorTypeId = void 0;
const ValidationErrorSymbolKey = "@effect/cli/ValidationError";

@@ -16,2 +16,5 @@ /** @internal */

exports.isValidationError = isValidationError;
const isExtraneousValue = validationError => validationError.type === "ExtraneousValue";
/** @internal */
exports.isExtraneousValue = isExtraneousValue;
const isInvalidValue = validationError => validationError.type === "InvalidValue";

@@ -39,2 +42,5 @@ /** @internal */

exports.make = make;
const extraneousValue = error => make("ExtraneousValue", error);
/** @internal */
exports.extraneousValue = extraneousValue;
const invalidValue = error => make("InvalidValue", error);

@@ -41,0 +47,0 @@ /** @internal */

@@ -8,2 +8,3 @@ /**

import type { ValidationError } from "@effect/cli/ValidationError";
import type { Chunk, NonEmptyChunk } from "@effect/data/Chunk";
import type { Either } from "@effect/data/Either";

@@ -82,2 +83,26 @@ import type { HashMap } from "@effect/data/HashMap";

* @since 1.0.0
* @category combinators
*/
export declare const atLeast: {
(times: 0): <A>(self: Options<A>) => Options<Chunk<A>>;
<A>(self: Options<A>, times: number): Options<Chunk<A>>;
};
/**
* @since 1.0.0
* @category combinators
*/
export declare const atMost: {
(times: number): <A>(self: Options<A>) => Options<Chunk<A>>;
<A>(self: Options<A>, times: number): Options<Chunk<A>>;
};
/**
* @since 1.0.0
* @category combinators
*/
export declare const between: {
(min: number, max: number): <A>(self: Options<A>) => Options<Chunk<A>>;
<A>(self: Options<A>, min: number, max: number): Options<Chunk<A>>;
};
/**
* @since 1.0.0
* @category constructors

@@ -194,2 +219,12 @@ */

* @since 1.0.0
* @category combinators
*/
export declare const repeat: <A>(self: Options<A>) => Options<Chunk<A>>;
/**
* @since 1.0.0
* @category combinators
*/
export declare const repeat1: <A>(self: Options<A>) => Options<NonEmptyChunk<A>>;
/**
* @since 1.0.0
* @category constructors

@@ -196,0 +231,0 @@ */

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

});
exports.zipWith = exports.zipFlatten = exports.zip = exports.withDescription = exports.withDefault = exports.validate = exports.usage = exports.uid = exports.text = exports.orElseEither = exports.orElse = exports.optional = exports.none = exports.mapTryCatch = exports.mapOrFail = exports.map = exports.keyValueMapFromOption = exports.keyValueMap = exports.isOptions = exports.isBool = exports.integer = exports.helpDoc = exports.float = exports.filterMap = exports.date = exports.choice = exports.boolean = exports.all = exports.alias = exports.OptionsTypeId = void 0;
exports.zipWith = exports.zipFlatten = exports.zip = exports.withDescription = exports.withDefault = exports.validate = exports.usage = exports.uid = exports.text = exports.repeat1 = exports.repeat = exports.orElseEither = exports.orElse = exports.optional = exports.none = exports.mapTryCatch = exports.mapOrFail = exports.map = exports.keyValueMapFromOption = exports.keyValueMap = exports.isOptions = exports.isBool = exports.integer = exports.helpDoc = exports.float = exports.filterMap = exports.date = exports.choice = exports.boolean = exports.between = exports.atMost = exports.atLeast = exports.all = exports.alias = exports.OptionsTypeId = void 0;
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/cli/internal_effect_untraced/options"));

@@ -30,5 +30,23 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

* @since 1.0.0
* @category combinators
*/
exports.all = all;
const atLeast = internal.atLeast;
/**
* @since 1.0.0
* @category combinators
*/
exports.atLeast = atLeast;
const atMost = internal.atMost;
/**
* @since 1.0.0
* @category combinators
*/
exports.atMost = atMost;
const between = internal.between;
/**
* @since 1.0.0
* @category constructors
*/
exports.all = all;
exports.between = between;
const boolean = internal.boolean;

@@ -142,5 +160,17 @@ /**

* @since 1.0.0
* @category combinators
*/
exports.orElseEither = orElseEither;
const repeat = internal.repeat;
/**
* @since 1.0.0
* @category combinators
*/
exports.repeat = repeat;
const repeat1 = internal.repeat1;
/**
* @since 1.0.0
* @category constructors
*/
exports.orElseEither = orElseEither;
exports.repeat1 = repeat1;
const text = internal.text;

@@ -147,0 +177,0 @@ /**

{
"name": "@effect/cli",
"version": "0.1.0",
"version": "0.2.0",
"license": "MIT",

@@ -12,4 +12,4 @@ "repository": {

"@effect/io": "^0.15.1",
"@effect/printer": "^0.2.0",
"@effect/printer-ansi": "^0.2.0"
"@effect/printer": "^0.3.0",
"@effect/printer-ansi": "^0.3.0"
},

@@ -16,0 +16,0 @@ "publishConfig": {

@@ -49,2 +49,3 @@ import type * as CliConfig from "@effect/cli/CliConfig"

| KeyValueMap
| Variadic
| WithDefault

@@ -89,2 +90,11 @@ | ZipWith

/** @internal */
export interface Variadic extends
Op<"Variadic", {
readonly options: Single
readonly min: Option.Option<number>
readonly max: Option.Option<number>
}>
{}
/** @internal */
export interface WithDefault extends

@@ -124,2 +134,20 @@ Op<"WithDefault", {

/** @internal */
export const atLeast = dual<
(times: number) => <A>(self: Options.Options<A>) => Options.Options<Chunk.Chunk<A>>,
<A>(self: Options.Options<A>, times: number) => Options.Options<Chunk.Chunk<A>>
>(2, (self, times) => variadic(self, Option.some(times), Option.none()))
/** @internal */
export const atMost = dual<
(times: number) => <A>(self: Options.Options<A>) => Options.Options<Chunk.Chunk<A>>,
<A>(self: Options.Options<A>, times: number) => Options.Options<Chunk.Chunk<A>>
>(2, (self, times) => variadic(self, Option.none(), Option.some(times)))
/** @internal */
export const between = dual<
(min: number, max: number) => <A>(self: Options.Options<A>) => Options.Options<Chunk.Chunk<A>>,
<A>(self: Options.Options<A>, min: number, max: number) => Options.Options<Chunk.Chunk<A>>
>(3, (self, min, max) => variadic(self, Option.some(min), Option.some(max)))
const defaultBooleanOptions = {

@@ -185,2 +213,3 @@ ifPresent: true,

KeyValueMap: (self) => helpDocMap[self.argumentOption._tag](self.argumentOption as any),
Variadic: (self) => helpDocMap[self.options._tag](self.options as any),
WithDefault: (self) => {

@@ -190,3 +219,10 @@ const helpDoc = helpDocMap[self.options._tag](self.options as any)

span,
doc.sequence(block, doc.p(`This setting is optional. (Defaults to: '${JSON.stringify(self.default)}')`))
doc.sequence(
block,
doc.p(
Option.isOption(self.default) ?
"This setting is optional." :
`This setting is optional. (Defaults to: '${JSON.stringify(self.default)}')`
)
)
])

@@ -216,2 +252,3 @@ },

KeyValueMap: () => false,
Variadic: () => false,
WithDefault: (self) => isBoolMap[self.options._tag](self.options as any),

@@ -317,2 +354,10 @@ Zip: () => false

/** @internal */
export const repeat = <A>(self: Options.Options<A>): Options.Options<Chunk.Chunk<A>> =>
variadic(self, Option.none(), Option.none())
/** @internal */
export const repeat1 = <A>(self: Options.Options<A>): Options.Options<Chunk.NonEmptyChunk<A>> =>
variadic(self, Option.some(1), Option.none()) as any
/** @internal */
export const text = (name: string): Options.Options<string> => single(name, Chunk.empty(), primitive.text)

@@ -328,2 +373,3 @@

KeyValueMap: (self) => uidMap[self.argumentOption._tag](self.argumentOption as any),
Variadic: (self) => uidMap[self.options._tag](self.options as any),
WithDefault: (self) => uidMap[self.options._tag](self.options as any),

@@ -358,2 +404,3 @@ Zip: (self) => combineUids(self.left, self.right)

KeyValueMap: (self) => usageMap[self.argumentOption._tag](self.argumentOption as any),
Variadic: (self) => _usage.optional(usageMap[self.options._tag](self.options as any)),
WithDefault: (self) => _usage.optional(usageMap[self.options._tag](self.options as any)),

@@ -463,2 +510,34 @@ Zip: (self) => {

),
Variadic: (self, args, config) => {
const min = Option.getOrElse(self.min, () => 0)
const max = Option.getOrElse(self.max, () => Infinity)
const loop = (
args: ReadonlyArray<string>,
acc: Chunk.Chunk<unknown>
): Effect.Effect<never, ValidationError.ValidationError, readonly [ReadonlyArray<string>, Chunk.Chunk<unknown>]> =>
Effect.matchEffect(
validateMap[self.options._tag](self.options as any, args, config),
(error) => {
if (!validationError.isMissingValue(error)) {
return Effect.fail(error)
} else if (acc.length < min) {
return Effect.fail(validationError.missingValue(
doc.p(span.error(`Expected at least ${min} value(s) for option: '${singleFullName(self.options)}'`))
))
}
return Effect.succeed([args, acc])
},
(tuple) => {
acc = Chunk.append(acc, tuple[1])
if (acc.length > max) {
return Effect.fail(validationError.extraneousValue(
doc.p(span.error(`Expected at most ${max} value(s) for option: '${singleFullName(self.options)}'`))
))
}
return loop(tuple[0], acc)
}
)
return loop(args, Chunk.empty())
},
WithDefault: (self, args, config) =>

@@ -513,2 +592,15 @@ Effect.catchSome(

const variadic = <A>(
self: Options.Options<A>,
min: Option.Option<number>,
max: Option.Option<number>
): Options.Options<Chunk.Chunk<A>> => {
const op = Object.create(proto)
op._tag = "Variadic"
op.options = self
op.min = min
op.max = max
return op
}
/** @internal */

@@ -643,2 +735,3 @@ export const withDefault = dual<

KeyValueMap: (self, f) => keyValueMapFromOption(f(self.argumentOption)),
Variadic: (self, f) => variadic(f(self.options), self.min, self.max),
WithDefault: (self, f) => withDefault(modifySingle(self.options, f), self.default),

@@ -670,7 +763,20 @@ Zip: (self, f) => zip(modifySingle(self.left, f), modifySingle(self.right, f))

): readonly [ReadonlyArray<string>, HashMap.HashMap<string, string>] => {
const [remaining, chunk] = processVariadicArg(repeat(self.argumentOption) as any, input, first, config)
const createMapEntry = (input: string): readonly [string, string] =>
input.split("=").slice(0, 2) as unknown as readonly [string, string]
return [remaining, HashMap.fromIterable(Chunk.map(chunk, createMapEntry))]
}
const processVariadicArg = (
self: Variadic,
input: ReadonlyArray<string>,
first: string,
config: CliConfig.CliConfig
): readonly [ReadonlyArray<string>, Chunk.Chunk<string>] => {
const max = Option.getOrElse(self.max, () => Infinity)
const makeFullName = (s: string): string => s.length === 1 ? `-${s}` : `--${s}`
const supports = (s: string, config: CliConfig.CliConfig): boolean => {
const argumentNames = Chunk.prepend(
Chunk.map(self.argumentOption.aliases, makeFullName),
makeFullName(self.argumentOption.name)
Chunk.map(self.options.aliases, makeFullName),
makeFullName(self.options.name)
)

@@ -681,11 +787,15 @@ return config.isCaseSensitive

}
const createMapEntry = (input: string): readonly [string, string] =>
input.split("=").slice(0, 2) as unknown as readonly [string, string]
const createMap = (input: ReadonlyArray<string>): HashMap.HashMap<string, string> =>
HashMap.fromIterable(RA.map(RA.filter(input, (s) => !s.startsWith("-")), createMapEntry))
const createChunk = (input: ReadonlyArray<string>): Chunk.Chunk<string> =>
Chunk.fromIterable(RA.filter(input, (s) => !s.startsWith("-")))
const tuple = RA.span(RA.fromIterable(input), (s) => !s.startsWith("-") || supports(s, config))
const remaining = tuple[1]
const firstEntry = createMapEntry(first)
const map = HashMap.set(createMap(tuple[0]), firstEntry[0], firstEntry[1])
return [remaining, map]
let chunk = Chunk.prepend(createChunk(tuple[0]), first)
if (max < Infinity) {
chunk = Chunk.take(chunk, max)
}
return [remaining, chunk]
}

@@ -692,0 +802,0 @@

@@ -16,2 +16,6 @@ import type * as HelpDoc from "@effect/cli/HelpDoc"

/** @internal */
export const isExtraneousValue = (validationError: ValidationError.ValidationError): boolean =>
validationError.type === "ExtraneousValue"
/** @internal */
export const isInvalidValue = (validationError: ValidationError.ValidationError): boolean =>

@@ -47,2 +51,6 @@ validationError.type === "InvalidValue"

/** @internal */
export const extraneousValue = (error: HelpDoc.HelpDoc): ValidationError.ValidationError =>
make("ExtraneousValue", error)
/** @internal */
export const invalidValue = (error: HelpDoc.HelpDoc): ValidationError.ValidationError => make("InvalidValue", error)

@@ -49,0 +57,0 @@

@@ -9,2 +9,3 @@ /**

import type { ValidationError } from "@effect/cli/ValidationError"
import type { Chunk, NonEmptyChunk } from "@effect/data/Chunk"
import type { Either } from "@effect/data/Either"

@@ -95,2 +96,29 @@ import type { HashMap } from "@effect/data/HashMap"

* @since 1.0.0
* @category combinators
*/
export const atLeast: {
(times: 0): <A>(self: Options<A>) => Options<Chunk<A>>
<A>(self: Options<A>, times: number): Options<Chunk<A>>
} = internal.atLeast
/**
* @since 1.0.0
* @category combinators
*/
export const atMost: {
(times: number): <A>(self: Options<A>) => Options<Chunk<A>>
<A>(self: Options<A>, times: number): Options<Chunk<A>>
} = internal.atMost
/**
* @since 1.0.0
* @category combinators
*/
export const between: {
(min: number, max: number): <A>(self: Options<A>) => Options<Chunk<A>>
<A>(self: Options<A>, min: number, max: number): Options<Chunk<A>>
} = internal.between
/**
* @since 1.0.0
* @category constructors

@@ -229,2 +257,14 @@ */

* @since 1.0.0
* @category combinators
*/
export const repeat: <A>(self: Options<A>) => Options<Chunk<A>> = internal.repeat
/**
* @since 1.0.0
* @category combinators
*/
export const repeat1: <A>(self: Options<A>) => Options<NonEmptyChunk<A>> = internal.repeat1
/**
* @since 1.0.0
* @category constructors

@@ -231,0 +271,0 @@ */

@@ -45,2 +45,3 @@ /**

export type Type =
| "ExtraneousValue"
| "InvalidValue"

@@ -61,2 +62,8 @@ | "MissingValue"

* @since 1.0.0
* @category refinements
*/
export const isExtraneousValue: (validationError: ValidationError) => boolean = internal.isExtraneousValue
/**
* @since 1.0.0
* @category predicates

@@ -100,2 +107,8 @@ */

*/
export const extraneousValue: (error: HelpDoc) => ValidationError = internal.extraneousValue
/**
* @since 1.0.0
* @category constructors
*/
export const invalidValue: (error: HelpDoc) => ValidationError = internal.invalidValue

@@ -102,0 +115,0 @@

@@ -38,3 +38,3 @@ /**

*/
type Type = "InvalidValue" | "MissingValue" | "CommandMismatch" | "MissingSubCommand" | "InvalidArgument";
type Type = "ExtraneousValue" | "InvalidValue" | "MissingValue" | "CommandMismatch" | "MissingSubCommand" | "InvalidArgument";
}

@@ -48,2 +48,7 @@ /**

* @since 1.0.0
* @category refinements
*/
export declare const isExtraneousValue: (validationError: ValidationError) => boolean;
/**
* @since 1.0.0
* @category predicates

@@ -81,2 +86,7 @@ */

*/
export declare const extraneousValue: (error: HelpDoc) => ValidationError;
/**
* @since 1.0.0
* @category constructors
*/
export declare const invalidValue: (error: HelpDoc) => ValidationError;

@@ -83,0 +93,0 @@ /**

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

});
exports.missingValue = exports.missingSubCommand = exports.make = exports.isValidationError = exports.isMissingValue = exports.isMissingSubCommand = exports.isInvalidValue = exports.isInvalidArgument = exports.isCommandMismatch = exports.invalidValue = exports.invalidArgument = exports.commandMismatch = exports.ValidationErrorTypeId = void 0;
exports.missingValue = exports.missingSubCommand = exports.make = exports.isValidationError = exports.isMissingValue = exports.isMissingSubCommand = exports.isInvalidValue = exports.isInvalidArgument = exports.isExtraneousValue = exports.isCommandMismatch = exports.invalidValue = exports.invalidArgument = exports.extraneousValue = exports.commandMismatch = exports.ValidationErrorTypeId = void 0;
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/cli/internal_effect_untraced/validationError"));

@@ -24,5 +24,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

* @since 1.0.0
* @category refinements
*/
exports.isValidationError = isValidationError;
const isExtraneousValue = internal.isExtraneousValue;
/**
* @since 1.0.0
* @category predicates
*/
exports.isValidationError = isValidationError;
exports.isExtraneousValue = isExtraneousValue;
const isInvalidValue = internal.isInvalidValue;

@@ -64,2 +70,8 @@ /**

exports.make = make;
const extraneousValue = internal.extraneousValue;
/**
* @since 1.0.0
* @category constructors
*/
exports.extraneousValue = extraneousValue;
const invalidValue = internal.invalidValue;

@@ -66,0 +78,0 @@ /**

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

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

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

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