Lint rules and flow annotations for rest of the files
This commit is contained in:
@ -1,9 +1,16 @@
|
||||
export default function apiWrapper(_options) {
|
||||
return async function apiWrapperMiddleware(ctx, next) {
|
||||
// @flow
|
||||
import { type Context } from 'koa';
|
||||
|
||||
export default function apiWrapper() {
|
||||
return async function apiWrapperMiddleware(
|
||||
ctx: Context,
|
||||
next: () => Promise<void>
|
||||
) {
|
||||
await next();
|
||||
|
||||
const ok = ctx.status < 400;
|
||||
|
||||
// $FlowFixMe
|
||||
ctx.body = {
|
||||
...ctx.body,
|
||||
status: ctx.status,
|
||||
|
Reference in New Issue
Block a user