Anton Astashov
4e4f50a2fc
@types/koa-compose: Add more typed compose cases ( #35298 )
...
* @types/koa-compose: Add more typed compose cases
Right now if you want typesafe compose, you have to compose composes by
2-element arrays. I.e. if you have 4 middlewares you want to compose
together, and you want to do that in a typesafe way, without losing type
information, you have to do it like this:
```ts
import compose from "koa-compose"
const myMiddleware = compose([
firstMiddleware,
compose([
secondMiddleware,
compose([
thirdMiddleware,
fourthMiddleware
])
])
]);
```
It works, but looks clunky it complicated. Would be cool to still have
type-safe way of composing, but with less clunkiness. Like:
```
import compose from "koa-compose"
const myMiddleware = compose([
firstMiddleware,
secondMiddleware,
thirdMiddleware,
fourthMiddleware
]);
```
It's hard to solve that issue for general case, but we could just add
typesafe compose overrides for up to e.g. 8-element arrays. If it's more
than 8 - you still can compose composes. But in general IMHO it will
reduce clunkiness of it.
* @types/koa-compose: Add Anton Astashov to the list of maintainers
2019-05-22 09:13:50 -07:00
..
2019-05-03 09:18:43 -07:00
2019-05-21 12:55:12 -07:00
2019-05-15 12:37:05 -07:00
2019-05-13 10:37:33 -07:00
2019-04-29 00:14:08 -07:00
2019-04-29 00:20:52 -07:00
2019-05-13 10:38:52 -07:00
2019-05-13 16:47:14 -07:00
2019-05-20 10:22:19 -07:00
2019-05-08 11:12:51 -07:00
2019-05-14 14:27:14 -07:00
2019-05-04 10:03:54 -07:00
2019-05-20 10:11:09 -07:00
2019-05-06 01:12:40 -07:00
2019-05-14 11:12:09 -07:00
2019-05-15 09:09:42 -07:00
2019-05-14 14:34:32 -07:00
2019-04-28 23:55:41 -07:00
2019-05-13 16:31:14 -07:00
2019-05-13 16:45:44 -07:00
2019-05-21 13:03:00 -07:00
2019-05-20 09:04:13 -07:00
2019-05-14 13:57:38 -07:00
2019-04-29 10:56:19 -07:00
2019-05-15 09:51:38 -07:00
2019-04-28 23:24:40 -07:00
2019-05-13 15:39:16 -07:00
2019-04-29 10:34:02 -07:00
2019-05-22 08:26:58 -07:00
2019-05-14 11:16:20 -07:00
2019-05-20 14:30:36 -07:00
2019-05-20 12:39:24 -07:00
2019-05-02 20:04:14 -07:00
2019-05-14 14:43:25 -07:00
2019-05-16 14:56:39 -07:00
2019-05-14 13:13:02 -07:00
2019-05-20 14:18:08 -07:00
2019-04-28 23:26:15 -07:00
2019-05-22 08:26:58 -07:00
2019-04-30 21:38:47 -07:00
2019-05-14 14:24:31 -07:00
2019-05-14 11:13:56 -07:00
2019-05-13 16:41:20 -07:00
2019-04-30 10:13:53 -07:00
2019-04-29 10:36:27 -07:00
2019-05-15 09:00:07 -07:00
2019-05-03 09:18:43 -07:00
2019-05-13 10:30:29 -07:00
2019-04-26 15:16:53 -07:00
2019-05-17 13:43:46 -07:00
2019-05-14 11:00:48 -07:00
2019-05-14 11:11:28 -07:00
2019-05-01 10:37:09 -07:00
2019-04-28 23:36:19 -07:00
2019-05-15 08:55:24 -07:00
2019-05-13 15:02:27 -07:00
2019-05-02 10:39:20 -07:00
2019-05-02 10:28:25 -07:00
2019-05-15 09:22:45 -07:00
2019-04-29 11:39:53 -07:00
2019-05-14 15:52:10 -07:00
2019-05-03 10:05:00 -07:00
2019-05-03 10:05:00 -07:00
2019-05-03 10:05:00 -07:00
2019-05-06 15:57:47 -07:00
2019-05-20 15:37:03 -07:00
2019-05-13 09:44:31 -07:00
2019-05-14 14:23:53 -07:00
2019-05-02 10:31:08 -07:00
2019-05-01 17:21:57 -07:00
2019-05-06 16:05:44 -07:00
2019-04-26 12:42:34 -07:00
2019-05-20 10:22:58 -07:00
2019-05-22 08:54:38 -07:00
2019-05-08 11:14:10 -07:00
2019-05-15 15:51:41 -07:00
2019-05-03 15:57:44 -07:00
2019-04-26 17:27:51 -07:00
2019-05-16 14:54:34 -07:00
2019-05-02 20:00:50 -07:00
2019-05-21 12:53:55 -07:00
2019-05-21 12:53:24 -07:00
2019-04-26 12:19:51 -07:00
2019-05-15 09:01:38 -07:00
2019-05-21 13:09:38 -07:00
2019-05-07 10:17:39 -07:00
2019-05-20 10:03:10 -07:00
2019-05-15 12:37:05 -07:00
2019-04-28 23:57:42 -07:00
2019-05-09 11:17:00 -07:00
2019-05-13 16:30:15 -07:00
2019-04-30 09:00:07 -07:00
2019-05-01 16:23:47 -07:00
2019-05-13 17:09:17 -07:00
2019-05-16 07:56:24 -07:00
2019-05-21 13:11:29 -07:00
2019-05-20 10:17:30 -07:00
2019-05-13 15:48:34 -07:00
2019-05-20 10:17:30 -07:00
2019-04-30 10:10:54 -07:00
2019-05-13 09:49:13 -07:00
2019-05-13 10:46:51 -07:00
2019-05-15 09:10:46 -07:00
2019-04-26 14:19:33 -07:00
2019-05-08 11:07:19 -07:00
2019-05-08 11:07:19 -07:00
2019-05-21 13:00:54 -07:00
2019-05-21 13:00:54 -07:00
2019-05-21 12:54:18 -07:00
2019-05-08 17:03:11 -07:00
2019-05-13 10:34:09 -07:00
2019-05-17 12:55:18 -07:00
2019-05-01 03:19:49 -07:00
2019-05-01 10:40:08 -07:00
2019-04-28 23:54:54 -07:00
2019-05-04 10:04:17 -07:00
2019-05-22 08:26:58 -07:00
2019-05-22 08:26:58 -07:00
2019-05-20 10:15:50 -07:00
2019-05-20 10:15:50 -07:00
2019-05-17 09:34:09 -07:00
2019-05-22 09:07:08 -07:00
2019-05-13 09:42:58 -07:00
2019-05-13 16:11:05 -07:00
2019-05-01 16:56:39 -07:00
2019-05-13 16:11:05 -07:00
2019-05-01 02:24:56 -07:00
2019-05-15 12:32:37 -07:00
2019-05-17 13:37:26 -07:00
2019-04-29 10:39:52 -07:00
2019-05-15 12:34:25 -07:00
2019-05-07 19:52:55 -07:00
2019-05-20 14:12:33 -07:00
2019-05-14 10:59:36 -07:00
2019-05-01 16:00:02 -07:00
2019-05-15 08:52:18 -07:00
2019-05-15 08:52:18 -07:00
2019-05-13 16:27:17 -07:00
2019-05-22 09:13:50 -07:00
2019-05-14 13:50:49 -07:00
2019-05-16 07:46:26 -07:00
2019-05-06 01:13:36 -07:00
2019-05-13 10:08:50 -07:00
2019-04-30 10:07:30 -07:00
2019-05-02 17:06:31 -07:00
2019-05-21 13:00:19 -07:00
2019-05-20 09:02:32 -07:00
2019-05-15 16:16:17 -07:00
2019-05-14 13:16:45 -07:00
2019-05-13 16:04:17 -07:00
2019-05-20 10:04:10 -07:00
2019-05-21 12:58:59 -07:00
2019-05-02 19:55:37 -07:00
2019-04-28 23:35:38 -07:00
2019-05-03 10:00:52 -07:00
2019-04-26 13:56:05 -07:00
2019-05-15 12:34:08 -07:00
2019-05-13 16:03:34 -07:00
2019-05-14 11:00:09 -07:00
2019-05-13 15:04:21 -07:00
2019-05-15 10:38:42 -07:00
2019-05-14 11:22:39 -07:00
2019-04-30 22:12:21 -07:00
2019-04-30 22:12:21 -07:00
2019-05-20 12:48:48 -07:00
2019-05-14 13:46:33 -07:00
2019-05-03 09:18:43 -07:00
2019-05-17 14:12:12 -07:00
2019-05-13 15:19:59 -07:00
2019-05-16 07:57:32 -07:00
2019-05-14 14:09:12 -07:00
2019-04-29 00:21:18 -07:00
2019-05-15 08:53:35 -07:00
2019-05-06 01:05:45 -07:00
2019-05-17 15:38:07 -07:00
2019-05-13 15:21:37 -07:00
2019-05-17 14:03:15 -07:00
2019-05-17 14:03:15 -07:00
2019-05-02 17:03:26 -07:00
2019-05-20 14:12:55 -07:00
2019-05-06 12:39:17 -07:00
2019-05-08 17:30:38 -07:00
2019-05-17 09:15:39 -07:00
2019-05-14 14:23:53 -07:00
2019-05-21 13:05:53 -07:00
2019-05-13 10:31:46 -07:00
2019-05-07 16:38:00 -07:00
2019-05-17 09:47:54 -07:00
2019-04-30 10:11:47 -07:00
2019-04-26 15:22:27 -07:00
2019-04-26 15:22:34 -07:00
2019-04-26 15:50:37 -07:00
2019-05-06 11:22:27 -07:00
2019-05-14 14:30:03 -07:00
2019-05-13 09:42:50 -07:00
2019-05-14 16:13:11 -07:00
2019-05-22 09:04:26 -07:00
2019-05-06 14:13:04 -07:00
2019-05-06 01:14:41 -07:00
2019-04-29 10:35:37 -07:00
2019-05-14 14:33:39 -07:00
2019-04-29 00:08:13 -07:00
2019-05-20 10:23:55 -07:00
2019-05-14 13:43:36 -07:00
2019-05-20 10:20:55 -07:00
2019-05-14 11:22:08 -07:00
2019-05-20 10:21:57 -07:00
2019-05-13 15:18:59 -07:00
2019-05-02 17:03:51 -07:00
2019-05-02 10:27:50 -07:00
2019-05-14 13:19:07 -07:00
2019-05-22 09:07:08 -07:00
2019-04-29 00:26:14 -07:00
2019-05-15 12:37:50 -07:00
2019-05-14 14:28:09 -07:00
2019-05-16 07:55:00 -07:00
2019-05-20 16:10:47 -07:00
2019-05-13 10:15:27 -07:00
2019-05-06 01:10:54 -07:00
2019-05-20 10:06:07 -07:00
2019-05-07 16:43:01 -07:00
2019-05-08 11:16:30 -07:00
2019-04-28 23:28:15 -07:00
2019-05-06 01:10:35 -07:00
2019-05-13 15:53:51 -07:00
2019-04-26 13:00:34 -07:00
2019-04-29 10:41:41 -07:00
2019-04-26 14:00:54 -07:00
2019-05-01 16:26:10 -07:00
2019-04-30 10:14:51 -07:00
2019-05-14 14:34:53 -07:00
2019-05-15 13:17:20 -07:00
2019-05-09 10:33:43 -07:00
2019-05-19 21:31:25 +02:00
2019-05-15 09:08:14 -07:00
2019-05-15 09:01:50 -07:00
2019-04-30 10:08:14 -07:00
2019-05-20 10:19:28 -07:00
2019-05-20 12:47:00 -07:00
2019-05-19 21:31:25 +02:00
2019-05-06 01:18:32 -07:00
2019-04-29 17:45:31 -07:00
2019-05-15 09:07:23 -07:00
2019-05-13 10:10:02 -07:00
2019-05-01 10:39:02 -07:00
2019-05-07 11:31:10 -07:00
2019-05-15 09:50:55 -07:00
2019-05-13 15:17:36 -07:00
2019-05-20 14:09:30 -07:00
2019-05-20 10:03:23 -07:00
2019-05-06 09:56:51 +01:00
2019-05-16 11:01:15 -07:00
2019-05-03 03:04:05 -07:00
2019-05-20 14:19:08 -07:00
2019-05-21 11:46:17 +02:00
2019-04-30 09:37:58 -07:00
2019-05-20 14:15:05 -07:00
2019-04-29 00:05:57 -07:00
2019-04-29 10:37:41 -07:00
2019-05-14 14:32:36 -07:00
2019-05-10 14:59:25 +09:00
2019-05-08 17:31:58 -07:00
2019-05-08 11:09:24 -07:00
2019-05-22 09:11:26 -07:00
2019-04-30 10:17:48 -07:00
2019-05-04 00:55:12 -07:00
2019-05-04 00:55:12 -07:00
2019-05-04 00:55:12 -07:00
2019-05-13 16:05:52 -07:00
2019-05-14 11:15:10 -07:00
2019-05-14 14:13:45 -07:00
2019-05-06 01:16:41 -07:00
2019-05-13 16:12:34 -07:00
2019-05-06 16:22:37 -07:00
2019-05-03 03:02:59 -07:00
2019-05-13 16:49:57 -07:00
2019-05-14 13:18:44 -07:00
2019-05-14 14:35:27 -07:00
2019-05-13 10:09:38 -07:00
2019-05-07 11:11:52 -07:00
2019-05-01 16:09:43 -07:00
2019-05-14 14:36:15 -07:00
2019-04-30 09:00:07 -07:00
2019-05-13 15:22:56 -07:00
2019-05-13 09:45:48 -07:00
2019-05-02 20:02:55 -07:00
2019-05-14 14:25:11 -07:00
2019-05-20 10:09:38 -07:00
2019-04-28 23:11:26 -07:00
2019-05-13 16:49:57 -07:00
2019-05-14 14:23:53 -07:00
2019-04-26 12:16:15 -07:00
2019-05-14 14:53:58 -07:00
2019-05-01 10:34:38 -07:00
2019-05-03 14:45:32 -07:00
2019-04-29 16:58:39 -07:00
2019-05-20 12:45:37 -07:00
2019-05-14 11:27:45 -07:00
2019-04-28 23:59:44 -07:00
2019-05-22 08:55:19 -07:00
2019-05-04 00:56:14 -07:00
2019-05-13 16:27:51 -07:00
2019-05-06 01:20:17 -07:00
2019-05-21 11:49:29 +02:00
2019-05-14 16:08:28 -07:00
2019-05-14 10:59:09 -07:00
2019-05-20 14:09:15 -07:00
2019-05-14 13:57:19 -07:00
2019-05-14 13:57:19 -07:00
2019-05-21 13:04:38 -07:00
2019-05-15 08:48:29 -07:00
2019-05-16 09:45:03 -07:00
2019-04-26 11:22:26 -07:00
2019-05-14 13:23:57 -07:00
2019-05-14 14:23:53 -07:00
2019-05-14 09:54:22 -07:00
2019-05-13 16:01:01 -07:00
2019-05-14 15:01:46 -07:00
2019-04-28 23:13:43 -07:00
2019-05-14 14:48:17 -07:00
2019-05-22 09:07:08 -07:00
2019-04-26 17:19:28 -07:00
2019-05-21 12:50:52 -07:00
2019-05-15 10:38:09 -07:00
2019-05-13 10:59:04 -07:00
2019-05-20 14:10:36 -07:00
2019-05-17 09:34:57 -07:00
2019-05-20 10:15:50 -07:00
2019-05-13 15:47:22 -07:00
2019-05-20 10:06:51 -07:00
2019-05-22 09:07:08 -07:00
2019-05-16 12:55:48 -07:00
2019-05-14 14:56:47 -07:00
2019-05-01 16:07:34 -07:00
2019-05-20 14:08:15 -07:00
2019-05-20 12:49:48 -07:00
2019-05-21 12:50:19 -07:00
2019-05-06 15:36:11 -07:00
2019-05-03 09:18:43 -07:00
2019-05-16 10:26:51 -07:00
2019-05-20 14:23:57 -07:00
2019-05-14 14:44:09 -07:00
2019-05-03 20:32:07 -07:00
2019-05-14 14:55:43 -07:00
2019-05-14 14:02:53 -07:00
2019-04-28 23:58:52 -07:00
2019-05-15 08:59:29 -07:00
2019-05-06 01:07:50 -07:00
2019-05-22 08:26:58 -07:00
2019-05-22 08:26:58 -07:00
2019-05-22 08:26:58 -07:00
2019-05-02 10:33:58 -07:00