( self: Command<Name, Input, ContextInput, E, R>, f: (handler: Effect.Effect<void, E | CliError.CliError, R | Environment>, input: Input) => Effect.Effect<void, E2, R2> )
| 1374 | |
| 1375 | // Internal helper: transforms a command's handler while preserving other properties |
| 1376 | const mapHandler = <Name extends string, Input, E, R, ContextInput, E2, R2>( |
| 1377 | self: Command<Name, Input, ContextInput, E, R>, |
| 1378 | f: (handler: Effect.Effect<void, E | CliError.CliError, R | Environment>, input: Input) => Effect.Effect<void, E2, R2> |
| 1379 | ): Command<Name, Input, ContextInput, E2, R2> => { |
| 1380 | const impl = toImpl(self) |
| 1381 | return makeCommand({ ...impl, handle: (input, path) => f(impl.handle(input, path), input) }) |
| 1382 | } |
| 1383 | |
| 1384 | /** |
| 1385 | * Provides the handler of a command with the services produced by a layer |
no test coverage detected