Skip to content

Commit ff341d2

Browse files
committed
client: add deprecation warning to .api calls
1 parent c74c2bb commit ff341d2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/client.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,14 @@ client.prototype.emits = function emits(types, values) {
8787

8888
client.prototype.off = client.prototype.removeListener;
8989

90-
client.prototype.api = api;
90+
var _apiWarned = false;
91+
client.prototype.api = (...args) => {
92+
if(!_apiWarned) {
93+
this.log.warn('Client.prototype.api is deprecated and will be removed by version 1.9.0');
94+
_apiWarned = true;
95+
}
96+
api(...args);
97+
};
9198

9299
// Put all commands in prototype..
93100
for(var methodName in commands) {

0 commit comments

Comments
 (0)