Skip to content

Commit 550616d

Browse files
committed
make aliases their own functions
1 parent cd5c051 commit 550616d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/tree_entry.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ TreeEntry.prototype.getTree = function(callback) {
4040
* Is this TreeEntry a blob? Alias for `isFile`
4141
* @return {Boolean}
4242
*/
43-
TreeEntry.prototype.isBlob = TreeEntry.prototype.isFile;
43+
TreeEntry.prototype.isBlob = function() {
44+
return this.isFile();
45+
};
4446

4547
/**
4648
* Is this TreeEntry a directory? Alias for `isTree`
4749
* @return {Boolean}
4850
*/
49-
TreeEntry.prototype.isDirectory = TreeEntry.prototype.isTree;
51+
TreeEntry.prototype.isDirectory = function() {
52+
return this.isTree();
53+
};
5054

5155
/**
5256
* Is this TreeEntry a blob? (i.e., a file)
@@ -77,7 +81,9 @@ TreeEntry.prototype.isTree = function() {
7781
* Retrieve the SHA for this TreeEntry. Alias for `sha`
7882
* @return {String}
7983
*/
80-
TreeEntry.prototype.oid = TreeEntry.prototype.sha;
84+
TreeEntry.prototype.oid = function() {
85+
return this.sha();
86+
};
8187

8288
/**
8389
* Returns the path for this entry.

0 commit comments

Comments
 (0)