From e5207ace51529e530416a95f5966cfb90ff77671 Mon Sep 17 00:00:00 2001 From: Ibrahim Ansari Date: Sun, 3 Jan 2021 21:52:11 +0530 Subject: [PATCH] Remove dependency on Node.js path. --- src/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 6c1d7e6..d5e8fc6 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,5 @@ const WebSocket = require('isomorphic-ws') const fetch = require('isomorphic-unfetch') -const path = require('path') /** * The Octyne API client. @@ -229,8 +228,8 @@ class Client { * @returns {Promise} A Promise which resolves on success and rejects on failure. */ renameFile (server, oldpath, newname) { - const newName = path.join(oldpath, '..', newname) - return this.moveFile(server, oldpath, newName) + const newpath = oldpath.substring(0, oldpath.lastIndexOf('/') + 1) + newname + return this.moveFile(server, oldpath, newpath) } /**