You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/index.js
+15-9Lines changed: 15 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ var Ul = require("ul")
14
14
,Typpy=require("typpy")
15
15
,Exec=ChildProcess.exec
16
16
,Spawn=ChildProcess.spawn
17
+
,IterateObject=require("iterate-object")
17
18
;
18
19
19
20
// Constants
@@ -209,7 +210,7 @@ GitStats.prototype.record = function (data, callback) {
209
210
* @function
210
211
* @param {Object} data The commit data containing:
211
212
*
212
-
* - `date` (String|Date): The date object or a string in a format that can be parsed.
213
+
* - `date` (String|Date): The date object or a string in a format that can be parsed. If not provided, the hash object will be searched in all dates.
213
214
* - `hash` (String): The commit hash.
214
215
* - `_data` (Object): If this field is provided, it should be the content of the git-stats data file as object. It will be modified in-memory and then returned.
215
216
* - `save` (Boolean): If `false`, the result will *not* be saved in the file.
@@ -230,8 +231,7 @@ GitStats.prototype.removeCommit = function (data, callback) {
230
231
}
231
232
232
233
if(!/^moment|date$/.test(Typpy(data.date))){
233
-
callback(newError("The date field should be a string or a date object."));
234
-
returnGitStats;
234
+
data.date=null;
235
235
}elseif(Typpy(data.date,Date)){
236
236
data.date=Moment(data.date);
237
237
}
@@ -244,13 +244,19 @@ GitStats.prototype.removeCommit = function (data, callback) {
0 commit comments