| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,8 +4,9 @@ var git = require('../'), | |||
| 4 | 4 | /** | |
| 5 | 5 | * Blob convenience class constructor. | |
| 6 | 6 | * | |
| 7 | - * @param {git.raw.Repo} rawRepo | ||
| 8 | - * @param {git.raw.Blob|null} rawBlob | ||
| 7 | + * @constructor | ||
| 8 | + * @param {git.raw.Repo} rawRepo Raw repository object. | ||
| 9 | + * @param {git.raw.Blob} [rawBlob = new git.raw.Blob(rawRepo)] Raw blob object. | ||
| 9 | 10 | */ | |
| 10 | 11 | var Blob = function(rawRepo, rawBlob) { | |
| 11 | 12 | if(!(rawRepo instanceof git.raw.Repo)) { | |
@@ -24,10 +25,15 @@ var Blob = function(rawRepo, rawBlob) { | |||
| 24 | 25 | /** | |
| 25 | 26 | * Retrieve the blob represented by the oid. | |
| 26 | 27 | * | |
| 27 | - * @param {git.raw.Oid} oid | ||
| 28 | - * @param {Function} callback | ||
| 28 | + * @param {git.raw.Oid} oid The OID representing the blob to lookup. | ||
| 29 | + * @param {Blob~lookupCallback} callback | ||
| 29 | 30 | */ | |
| 30 | 31 | Blob.prototype.lookup = function(oid, callback) { | |
| 32 | + /** | ||
| 33 | + * @callback Blob~lookupCallback Callback executed on lookup completion. | ||
| 34 | + * @param {GitError|null} error An Error or null if successful. | ||
| 35 | + * @param {Blob|null} blob The populated blob object or null. | ||
| 36 | + */ | ||
| 31 | 37 | var self = this; | |
| 32 | 38 | self.rawBlob.lookup(self.rawRepo, oid, function blobLookup(error, rawBlob) { | |
| 33 | 39 | if (success(error, callback)) { | |
@@ -40,9 +46,14 @@ Blob.prototype.lookup = function(oid, callback) { | |||
| 40 | 46 | /** | |
| 41 | 47 | * Retrieve the blob's raw content buffer. | |
| 42 | 48 | * | |
| 43 | - * @param {Function} callback | ||
| 49 | + * @param {Blob~rawContentCallback} callback | ||
| 44 | 50 | */ | |
| 45 | 51 | Blob.prototype.rawContent = function(callback) { | |
| 52 | + /** | ||
| 53 | + * @callback Blob~rawContentCallback Callback executed after raw content is retrieved. | ||
| 54 | + * @param {GitError|null} error An Error or null if successful. | ||
| 55 | + * @param {Buffer|null} content The raw content of the blob or null. | ||
| 56 | + */ | ||
| 46 | 57 | this.rawBlob.rawContent(function(error, content) { | |
| 47 | 58 | if (success(error, callback)) { | |
| 48 | 59 | callback(null, content); | |
@@ -53,9 +64,14 @@ Blob.prototype.rawContent = function(callback) { | |||
| 53 | 64 | /** | |
| 54 | 65 | * Retrieve the blob's content. | |
| 55 | 66 | * | |
| 56 | - * @param {Function} callback | ||
| 67 | + * @param {Blob~contentCallback} callback | ||
| 57 | 68 | */ | |
| 58 | 69 | Blob.prototype.content = function(callback) { | |
| 70 | + /** | ||
| 71 | + * @callback Blob~contentCallback Callback executed after content is retrieved. | ||
| 72 | + * @param {GitError|null} error An Error or null if successful. | ||
| 73 | + * @param {String|null} content The content of the blob or null. | ||
| 74 | + */ | ||
| 59 | 75 | this.rawContent(function(error, content) { | |
| 60 | 76 | if (success(error, callback)) { | |
| 61 | 77 | callback(null, content.toString()); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments