@effect/cli
Advanced tools
Comparing version 0.41.1 to 0.41.2
@@ -224,6 +224,8 @@ "use strict"; | ||
{ | ||
return Effect.match(options.validate(state.value), { | ||
const value = state.value.length > 0 ? state.value : options.default; | ||
return Effect.match(options.validate(value), { | ||
onFailure: error => _action.Action.NextFrame({ | ||
state: { | ||
...state, | ||
value, | ||
error: Option.some(error) | ||
@@ -230,0 +232,0 @@ } |
@@ -216,6 +216,8 @@ import * as Terminal from "@effect/platform/Terminal"; | ||
{ | ||
return Effect.match(options.validate(state.value), { | ||
const value = state.value.length > 0 ? state.value : options.default; | ||
return Effect.match(options.validate(value), { | ||
onFailure: error => Action.NextFrame({ | ||
state: { | ||
...state, | ||
value, | ||
error: Option.some(error) | ||
@@ -222,0 +224,0 @@ } |
{ | ||
"name": "@effect/cli", | ||
"version": "0.41.1", | ||
"version": "0.41.2", | ||
"description": "A library for building command-line interfaces with Effect", | ||
@@ -18,7 +18,7 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@effect/platform": "^0.62.1", | ||
"@effect/printer": "^0.34.4", | ||
"@effect/printer-ansi": "^0.34.4", | ||
"@effect/schema": "^0.71.0", | ||
"effect": "^3.6.4" | ||
"@effect/platform": "^0.62.2", | ||
"@effect/printer": "^0.34.5", | ||
"@effect/printer-ansi": "^0.34.5", | ||
"@effect/schema": "^0.71.1", | ||
"effect": "^3.6.5" | ||
}, | ||
@@ -25,0 +25,0 @@ "publishConfig": { |
@@ -235,6 +235,7 @@ import * as Terminal from "@effect/platform/Terminal" | ||
case "return": { | ||
return Effect.match(options.validate(state.value), { | ||
const value = state.value.length > 0 ? state.value : options.default | ||
return Effect.match(options.validate(value), { | ||
onFailure: (error) => | ||
Action.NextFrame({ | ||
state: { ...state, error: Option.some(error) } | ||
state: { ...state, value, error: Option.some(error) } | ||
}), | ||
@@ -268,2 +269,3 @@ onSuccess: (value) => Action.Submit({ value }) | ||
} | ||
return InternalPrompt.custom(initialState, { | ||
@@ -270,0 +272,0 @@ render: handleRender(opts), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2013750
32714