@fastcar/koa 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { FastCarApplication, Logger } from "@fastcar/core";
2
2
  import * as Koa from "koa";
3
- import * as koaBody from "koa-body";
4
- import * as bodyParser from "koa-bodyparser";
5
3
  import { ServerConfig } from "@fastcar/server";
6
4
 
7
5
  type MiddleWareType = (...args: any) => Koa.Middleware | Koa.Middleware[];
@@ -37,8 +35,8 @@ export class KoaApplication {
37
35
  export type KoaConfig = {
38
36
  server: ServerConfig[] | ServerConfig; //监听的端口号
39
37
  koaStatic?: string[]; //相对路径为resource下的 或者绝对文件路径
40
- koaBodyOptions?: koaBody.IKoaBodyOptions; //文件上传的解析
41
- koaBodyParser?: bodyParser.Options; //解析请求
38
+ koaBodyOptions?: { [key: string]: any }; //文件上传的解析
39
+ koaBodyParser?: { [key: string]: any }; //解析请求
42
40
  extra?: { [key: string]: any }; //拓展设置
43
41
  };
44
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastcar/koa",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "homepage": "https://github.com/williamDazhangyu/fast-car",
5
5
  "description": "fastcar框架下对koa的包装",
6
6
  "main": "target/index.js",
@@ -110,6 +110,9 @@
110
110
  },
111
111
  "@types/koa__multer": {
112
112
  "optional": true
113
+ },
114
+ "@koa/multer": {
115
+ "optional": true
113
116
  }
114
117
  },
115
118
  "repository": {
@@ -16,8 +16,8 @@ export default function KoaStatic(app: FastCarApplication): Koa.Middleware[] {
16
16
  let koaConfig: KoaConfig = app.getSetting("koa");
17
17
 
18
18
  if (!!koaConfig?.koaStatic) {
19
- const KoaMount = require("koa-mount").default;
20
- const koaStatic = require("koa-static").default;
19
+ const KoaMount = require("koa-mount");
20
+ const koaStatic = require("koa-static");
21
21
 
22
22
  let keys = Object.keys(koaConfig?.koaStatic);
23
23
  if (keys.length > 0) {
@@ -11,8 +11,8 @@ function KoaStatic(app) {
11
11
  mlist.push(KoaRange);
12
12
  let koaConfig = app.getSetting("koa");
13
13
  if (!!koaConfig?.koaStatic) {
14
- const KoaMount = require("koa-mount").default;
15
- const koaStatic = require("koa-static").default;
14
+ const KoaMount = require("koa-mount");
15
+ const koaStatic = require("koa-static");
16
16
  let keys = Object.keys(koaConfig?.koaStatic);
17
17
  if (keys.length > 0) {
18
18
  for (let key of keys) {