(options: IntegerOptions)
| 989 | never, |
| 990 | Environment |
| 991 | > = Effect.gen(function*() { |
| 992 | const currentPath = yield* resolveCurrentPath(Option.none(), opts) |
| 993 | const path = yield* Path.Path |
| 994 | const defaultPath = Option.map(opts.default, (defaultValue) => path.resolve(currentPath, defaultValue)) |
| 995 | const initialPath = Option.match(defaultPath, { |
| 996 | onNone: () => currentPath, |
| 997 | onSome: (defaultPath) => path.dirname(defaultPath) |
| 998 | }) |
| 999 | const files = yield* getFileList(initialPath, opts) |
| 1000 | const cursor = Option.match(defaultPath, { |
| 1001 | onNone: () => 0, |
| 1002 | onSome: (defaultPath) => { |
| 1003 | const index = files.indexOf(path.basename(defaultPath)) |
| 1004 | return index === -1 ? 0 : index |
| 1005 | } |
| 1006 | }) |
| 1007 | const confirm = FileConfirm.Hide() |
| 1008 | return { cursor, files, allFiles: files, query: "", path: Option.map(defaultPath, path.dirname), confirm } |
| 1009 | }) |
| 1010 | return Custom(initialState, { |
| 1011 | render: handleFileRender(opts), |
| 1012 | process: handleFileProcess(opts), |
| 1013 | clear: handleFileClear(opts) |
| 1014 | }) |
| 1015 | } |
| 1016 | |
| 1017 | /** |
| 1018 | * Composes prompts by using the output of this prompt to create the next prompt. |
| 1019 | * |
| 1020 | * @category combinators |
| 1021 | * @since 4.0.0 |
| 1022 | */ |
| 1023 | export const flatMap: { |
nothing calls this directly
no test coverage detected
searching dependent graphs…