wasm-rdp/filegateway/utility.js

18 lines
597 B
JavaScript
Raw Normal View History

2024-05-03 19:36:53 +00:00
/**
* @typedef {import("@awo00/smb2/dist/client/Tree").default} Tree
*/
module.exports = {
/**
* Retrieves the specified tree from the session.
* @param {Session} session - The session object.
* @param {string} tree_name - The name of the tree to retrieve.
* @returns {Promise<Tree>} The retrieved tree.
*/
async getTree(session, tree_name) {
if (!session.trees[tree_name.toLowerCase()]) {
session.trees[tree_name.toLowerCase()] = await session.connectTree(tree_name);
}
return session.trees[tree_name.toLowerCase()]
}
};