Skip to content

Commit

Permalink
Removed the 'moveTo' method in the 'VirtualResource' class to use the…
Browse files Browse the repository at this point in the history
… default implementation in 'StandardResource'
  • Loading branch information
AdrienCastex committed Jun 20, 2017
1 parent d0aa8c8 commit 1a38d52
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion lib/resource/virtual/VirtualResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export declare abstract class VirtualResource extends StandardResource {
constructor(name: string, parent?: IResource, fsManager?: FSManager);
create(callback: SimpleCallback): void;
delete(callback: SimpleCallback): void;
moveTo(parent: IResource, newName: string, overwrite: boolean, callback: SimpleCallback): void;
rename(newName: string, callback: Return2Callback<string, string>): void;
webName(callback: ReturnCallback<string>): void;
abstract type(callback: ReturnCallback<ResourceType>): any;
Expand Down
5 changes: 2 additions & 3 deletions lib/resource/virtual/VirtualResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ var VirtualResource = (function (_super) {
_this.name = name;
return _this;
}
// ****************************** Actions ****************************** //
VirtualResource.prototype.create = function (callback) {
callback(null);
};
VirtualResource.prototype.delete = function (callback) {
this.removeFromParent(callback);
};
VirtualResource.prototype.moveTo = function (parent, newName, overwrite, callback) {
StandardResource_1.StandardResource.standardMoveTo(this, parent, newName, overwrite, callback);
};
VirtualResource.prototype.rename = function (newName, callback) {
var oldName = this.name;
this.name = newName;
callback(null, oldName, newName);
};
// ****************************** Std meta-data ****************************** //
VirtualResource.prototype.webName = function (callback) {
callback(null, this.name);
};
Expand Down
4 changes: 0 additions & 4 deletions src/resource/virtual/VirtualResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ export abstract class VirtualResource extends StandardResource
{
this.removeFromParent(callback);
}
moveTo(parent : IResource, newName : string, overwrite : boolean, callback : SimpleCallback)
{
StandardResource.standardMoveTo(this, parent, newName, overwrite, callback);
}
rename(newName : string, callback : Return2Callback<string, string>)
{
const oldName = this.name;
Expand Down

0 comments on commit 1a38d52

Please sign in to comment.