From 6d8f0dfae8106deb2fee0a7ae15b6ca9802a066d Mon Sep 17 00:00:00 2001 From: vince Date: Tue, 27 Feb 2018 16:15:41 +0100 Subject: [PATCH] refactor: create alias method instead of modify prototype --- lib/API.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/API.js b/lib/API.js index 60c69380d..0c9519fd8 100644 --- a/lib/API.js +++ b/lib/API.js @@ -210,6 +210,14 @@ class API { }); }; + /** + * Alias on disconnect + * @param cb + */ + close (cb) { + this.disconnect(cb); + } + /** * Launch modules * @@ -617,6 +625,10 @@ class API { }); } + kill (cb) { + this.killDaemon(cb); + } + ///////////////////// // Private methods // ///////////////////// @@ -1653,9 +1665,6 @@ class API { } }; -API.prototype.close = API.prototype.disconnect; -API.prototype.kill = API.prototype.killDaemon; - ////////////////////////// // Load all API methods //