@midwayjs/core 3.1.2 → 3.1.5

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.
@@ -6,6 +6,7 @@ export declare abstract class ServiceFactory<T> {
6
6
  protected options: {};
7
7
  protected initClients(options?: any): Promise<void>;
8
8
  get<U = T>(id?: string): U;
9
+ has(id: string): boolean;
9
10
  createInstance(config: any, clientName?: any): Promise<T | void>;
10
11
  abstract getName(): string;
11
12
  protected abstract createClient(config: any, clientName: any): Promise<T | void> | (T | void);
@@ -28,6 +28,9 @@ class ServiceFactory {
28
28
  get(id = 'default') {
29
29
  return this.clients.get(id);
30
30
  }
31
+ has(id) {
32
+ return this.clients.has(id);
33
+ }
31
34
  async createInstance(config, clientName) {
32
35
  // options.default will be merge in to options.clients[id]
33
36
  config = Object.assign({}, this.options['default'], config);
@@ -36,6 +36,7 @@ export declare function joinURLPath(...strArray: any[]): string;
36
36
  * 代理目标所有的原型方法,不包括构造器和内部隐藏方法
37
37
  * @param derivedCtor
38
38
  * @param constructors
39
+ * @param otherMethods
39
40
  * @since 2.0.0
40
41
  */
41
42
  export declare function delegateTargetPrototypeMethod(derivedCtor: any, constructors: any[], otherMethods?: string[]): void;
@@ -112,6 +112,7 @@ exports.joinURLPath = joinURLPath;
112
112
  * 代理目标所有的原型方法,不包括构造器和内部隐藏方法
113
113
  * @param derivedCtor
114
114
  * @param constructors
115
+ * @param otherMethods
115
116
  * @since 2.0.0
116
117
  */
117
118
  function delegateTargetPrototypeMethod(derivedCtor, constructors, otherMethods) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/core",
3
- "version": "3.1.2",
3
+ "version": "3.1.5",
4
4
  "description": "midway core",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -45,5 +45,5 @@
45
45
  "engines": {
46
46
  "node": ">=12"
47
47
  },
48
- "gitHead": "4ff3aa892b76d016f0ea123c7f9520d054d5c96b"
48
+ "gitHead": "46a7851ad3ce6fc675bd7e1b7c9dff2c70009104"
49
49
  }