Comparing version 2.1.0 to 2.1.1
@@ -32,3 +32,3 @@ "use strict"; | ||
if (typeof target.getInstance === "function") { | ||
return target.getInstance(); | ||
return target.getInstance(...args); | ||
} | ||
@@ -35,0 +35,0 @@ else { |
{ | ||
"name": "asrpc", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "A tool to make your class as an RPC service.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -179,4 +179,4 @@ # AS-RPC | ||
By default, this module will try to get the instance by using keyword `new`, | ||
however, if the `target` provides a static method `getInstance()` (without | ||
parameters), it will try to call this method to get the instance instead. | ||
however, if the `target` provides a static method `getInstance()`, it will try | ||
to call this method to get the instance instead. | ||
@@ -183,0 +183,0 @@ ```typescript |
@@ -24,3 +24,3 @@ import * as net from "net"; | ||
id?: string; | ||
getInstance?(): T; | ||
getInstance?(...args: any[]): T; | ||
} | ||
@@ -27,0 +27,0 @@ |
@@ -39,3 +39,3 @@ import hash = require("object-hash"); | ||
if (typeof target.getInstance === "function") { | ||
return target.getInstance(); | ||
return target.getInstance(...args); | ||
} else { | ||
@@ -42,0 +42,0 @@ try { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58626