Skip to content

Commit

Permalink
Changed to check by reference by default when seeking for a file system
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienCastex committed Jun 30, 2017
1 parent 8908c87 commit e39fd71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/server/v2/webDAVServer/WebDAVServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ var WebDAVServer = (function () {
return true;
};
WebDAVServer.prototype.removeFileSystem = function (fs_path, _checkByReference, _callback) {
var checkByReference = _callback ? _checkByReference : false;
var checkByReference = _callback ? _checkByReference : true;
var callback = _callback ? _callback : _checkByReference;
var result = this.removeFileSystemSync(fs_path, checkByReference);
if (callback)
callback(result);
};
WebDAVServer.prototype.removeFileSystemSync = function (fs_path, checkByReference) {
if (checkByReference === void 0) { checkByReference = false; }
if (checkByReference === void 0) { checkByReference = true; }
if (fs_path.constructor === Path_1.Path || fs_path.constructor === String) {
var path = new Path_1.Path(fs_path).toString();
if (this.fileSystems[path] === undefined)
Expand Down
4 changes: 2 additions & 2 deletions src/server/v2/webDAVServer/WebDAVServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class WebDAVServer
removeFileSystem(fs : FileSystem, checkByReference : boolean, callback : (nbRemoved ?: number) => void) : void
removeFileSystem(fs_path : Path | string | FileSystem, _checkByReference : boolean | ((nbRemoved ?: number) => void), _callback ?: (nbRemoved ?: number) => void) : void
{
const checkByReference = _callback ? _checkByReference as boolean : false;
const checkByReference = _callback ? _checkByReference as boolean : true;
const callback = _callback ? _callback : _checkByReference as ((nbRemoved ?: number) => void);

const result = this.removeFileSystemSync(fs_path as any, checkByReference);
Expand All @@ -126,7 +126,7 @@ export class WebDAVServer

removeFileSystemSync(path : Path | string) : number
removeFileSystemSync(fs : FileSystem, checkByReference ?: boolean) : number
removeFileSystemSync(fs_path : Path | string | FileSystem, checkByReference : boolean = false) : number
removeFileSystemSync(fs_path : Path | string | FileSystem, checkByReference : boolean = true) : number
{
if(fs_path.constructor === Path || fs_path.constructor === String)
{
Expand Down

0 comments on commit e39fd71

Please sign in to comment.