Commit aab04e11 authored by Julien Fontanet's avatar Julien Fontanet

chore: add name to all API functions

Having `.name` property defined helps for debugging.
parent c26cd908
...@@ -9,6 +9,6 @@ var SMB2Connection = require('../tools/smb2-connection'); ...@@ -9,6 +9,6 @@ var SMB2Connection = require('../tools/smb2-connection');
* - close TCP connection * - close TCP connection
* *
*/ */
module.exports = function() { module.exports = function disconnect() {
SMB2Connection.close(this); SMB2Connection.close(this);
}; };
...@@ -12,7 +12,7 @@ var SMB2Forge = require('../tools/smb2-forge'), ...@@ -12,7 +12,7 @@ var SMB2Forge = require('../tools/smb2-forge'),
* - close the file * - close the file
* *
*/ */
module.exports = function(path, cb) { module.exports = function exists(path, cb) {
var connection = this; var connection = this;
SMB2Request('open', { path: path }, connection, function(err, file) { SMB2Request('open', { path: path }, connection, function(err, file) {
......
...@@ -12,7 +12,7 @@ var SMB2Forge = require('../tools/smb2-forge'), ...@@ -12,7 +12,7 @@ var SMB2Forge = require('../tools/smb2-forge'),
* - close the folder * - close the folder
* *
*/ */
module.exports = function(path, mode, cb) { module.exports = function mkdir(path, mode, cb) {
if (typeof mode == 'function') { if (typeof mode == 'function') {
cb = mode; cb = mode;
mode = '0777'; mode = '0777';
......
...@@ -14,7 +14,7 @@ var SMB2Forge = require('../tools/smb2-forge'), ...@@ -14,7 +14,7 @@ var SMB2Forge = require('../tools/smb2-forge'),
* - close the directory * - close the directory
* *
*/ */
module.exports = function(path, cb) { module.exports = function readdir(path, cb) {
var connection = this; var connection = this;
// SMB2 open directory // SMB2 open directory
......
...@@ -16,7 +16,7 @@ var SMB2Forge = require('../tools/smb2-forge'), ...@@ -16,7 +16,7 @@ var SMB2Forge = require('../tools/smb2-forge'),
* - close the file * - close the file
* *
*/ */
module.exports = function(filename, options, cb) { module.exports = function readFile(filename, options, cb) {
var connection = this; var connection = this;
if (typeof options == 'function') { if (typeof options == 'function') {
......
...@@ -15,7 +15,7 @@ var FILE_OPEN_IF = require('../structures/constants').FILE_OPEN_IF; ...@@ -15,7 +15,7 @@ var FILE_OPEN_IF = require('../structures/constants').FILE_OPEN_IF;
* - close the file * - close the file
* *
*/ */
module.exports = function(oldPath, newPath, cb) { module.exports = function rename(oldPath, newPath, cb) {
var connection = this; var connection = this;
// SMB2 open the folder / file // SMB2 open the folder / file
......
...@@ -15,7 +15,7 @@ var SMB2Forge = require('../tools/smb2-forge'), ...@@ -15,7 +15,7 @@ var SMB2Forge = require('../tools/smb2-forge'),
* - close the folder * - close the folder
* *
*/ */
module.exports = function(path, cb) { module.exports = function rmdir(path, cb) {
var connection = this; var connection = this;
connection.exists(path, function(err, exists) { connection.exists(path, function(err, exists) {
......
...@@ -15,7 +15,7 @@ var SMB2Forge = require('../tools/smb2-forge'), ...@@ -15,7 +15,7 @@ var SMB2Forge = require('../tools/smb2-forge'),
* - close the file * - close the file
* *
*/ */
module.exports = function(path, cb) { module.exports = function unlink(path, cb) {
var connection = this; var connection = this;
connection.exists(path, function(err, exists) { connection.exists(path, function(err, exists) {
......
...@@ -17,7 +17,7 @@ var SMB2Forge = require('../tools/smb2-forge'), ...@@ -17,7 +17,7 @@ var SMB2Forge = require('../tools/smb2-forge'),
* - close the file * - close the file
* *
*/ */
module.exports = function(filename, data, options, cb) { module.exports = function writeFile(filename, data, options, cb) {
if (typeof options == 'function') { if (typeof options == 'function') {
cb = options; cb = options;
options = {}; options = {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment