Skip to content

Commit 4538e6d

Browse files
committed
Ensure constructors export their native wrappers
1 parent 9b2f3a3 commit 4538e6d

File tree

20 files changed

+96
-70
lines changed

20 files changed

+96
-70
lines changed

.jshintrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"eqnull": true,
66
"maxlen": 80,
77
"node": true,
8+
"proto": true,
89
"curly": true,
910
"quotmark": "double",
1011
"trailing": true,
@@ -13,6 +14,10 @@
1314
"validthis": true,
1415
"globals": {
1516
"global": true,
16-
"define": true
17+
"define": true,
18+
"it": true,
19+
"describe": true,
20+
"before": true,
21+
"beforeEach": true
1722
}
1823
}

lib/blob.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
var NodeGit = require("../");
22
var TreeEntry = require("./tree_entry");
3-
var Blob = NodeGit.Blob;
43

5-
var FileMode = TreeEntry.FileMode;
4+
var Blob = NodeGit.Blob;
65

76
/**
87
* Retrieve the content of the Blob.
@@ -28,5 +27,9 @@ Blob.prototype.toString = function() {
2827
* @return {number} The filemode.
2928
*/
3029
Blob.prototype.filemode = function() {
30+
var FileMode = TreeEntry.FileMode;
31+
3132
return this.isBinary() ? FileMode.Executable : FileMode.Blob;
3233
};
34+
35+
module.exports = Blob;

lib/commit.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
var Promise = require("promise");
2-
var git = require("../");
3-
var Commit = git.Commit;
41
var events = require("events");
2+
var Promise = require("promise");
3+
var NodeGit = require("../");
4+
5+
var Commit = NodeGit.Commit;
56

67
/**
78
* Retrieve the SHA.
@@ -194,3 +195,5 @@ Commit.prototype.getDiff = function(callback) {
194195
Commit.prototype.toString = function() {
195196
return this.sha();
196197
};
198+
199+
module.exports = Commit;

lib/convenient_patch.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
var git = require('../');
1+
var git = require("../");
22
var Diff = git.Diff;
3-
var ConvenientHunk = require('./convenient_hunk').ConvenientHunk;
3+
var ConvenientHunk = require("./convenient_hunk").ConvenientHunk;
44

55
function ConvenientPatch(delta, patch) {
66
this.delta = delta;
@@ -126,4 +126,4 @@ ConvenientPatch.prototype.isTypeChange = function() {
126126
return this.status() == Diff.Delta.TypeChange;
127127
};
128128

129-
exports.ConvenientPatch = ConvenientPatch;
129+
module.exports = ConvenientPatch;

lib/diff.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
var git = require('../');
2-
var Diff = git.Diff;
3-
var Patch = git.Patch;
4-
var ConvenientPatch = require('./convenient_patch').ConvenientPatch;
5-
var events = require('events');
1+
var NodeGit = require("../");
2+
var Patch = require("./patch");
3+
var ConvenientPatch = require("./convenient_patch");
4+
5+
var Diff = NodeGit.Diff;
66

77
Object.defineProperties(Diff.prototype, {
88
size: {
@@ -36,14 +36,14 @@ Diff.Delta = {
3636
* @enum {String}
3737
*/
3838
Diff.LineOrigin = {
39-
/** ' ' */ Context: 32,
40-
/** '+' */ Addition: 43,
41-
/** '-' */ Deletion: 45,
42-
/** '\n' */ AddEofNl: 13,
43-
/** '' */ DelEofNl: 0,
44-
/** 'F' */ FileHdr: 106,
45-
/** 'H' */ HunkHdr: 110,
46-
/** 'B' */ Binary: 102
39+
/** " " */ Context: 32,
40+
/** "+" */ Addition: 43,
41+
/** "-" */ Deletion: 45,
42+
/** "\n" */ AddEofNl: 13,
43+
/** "" */ DelEofNl: 0,
44+
/** "F" */ FileHdr: 106,
45+
/** "H" */ HunkHdr: 110,
46+
/** "B" */ Binary: 102
4747
};
4848

4949
/**
@@ -59,3 +59,5 @@ Diff.prototype.patches = function() {
5959
}
6060
return result;
6161
};
62+
63+
module.exports = Diff;

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var git = require('../'),
1+
var git = require("../"),
22
Index = git.Index;
33

44
/**

lib/object.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var git = require('../');
1+
var git = require("../");
22

33
git.Object.Type = {
44
Any: -2, /**< Object can be any of the following */

lib/odb.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var git = require('../'),
2-
util = require('./util.js'),
1+
var git = require("../"),
2+
util = require("./util.js"),
33
Odb = git.Odb;
44

55
/**
@@ -9,5 +9,5 @@ var git = require('../'),
99
* @param {Function} callback
1010
* @return {git.Object} a git odb object
1111
*/
12-
util.normalizeOid(Odb.prototype, 'read');
13-
util.makeSafe(Odb.prototype, 'read');
12+
util.normalizeOid(Odb.prototype, "read");
13+
util.makeSafe(Odb.prototype, "read");

lib/oid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var git = require('../'),
1+
var git = require("../"),
22
Oid = git.Oid;
33

44
// Backwards compatibility.

lib/patch.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var NodeGit = require("../");
2+
3+
var Patch = NodeGit.Patch;
4+
5+
module.exports = Patch;

0 commit comments

Comments
 (0)