File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -74,23 +74,26 @@ GitStats.DEFAULT_CONFIG = {
7474 * @return {Object|Undefined } If no callback is provided, the configuration object will be returned.
7575 */
7676GitStats . prototype . getConfig = function ( callback ) {
77- var data = null ;
77+ var data = { }
78+ , err = null
79+ ;
80+
7881 try {
7982 data = require ( CONFIG_PATH ) ;
8083 } catch ( err ) {
81- if ( err . code !== "MODULE_NOT_FOUND" ) {
82- if ( callback ) {
83- return callback ( err ) ;
84- } else {
85- throw err ;
86- }
84+ if ( err . code === "MODULE_NOT_FOUND" ) {
85+ err = null ;
86+ data = { } ;
8787 }
88- return { } ;
8988 }
89+
9090 if ( callback ) {
91- callback ( null , data ) ;
91+ return callback ( err , data ) ;
92+ } else {
93+ if ( err ) {
94+ throw err ;
95+ }
9296 }
93- return data ;
9497} ;
9598
9699/**
@@ -105,6 +108,7 @@ GitStats.prototype.getConfig = function (callback) {
105108GitStats . prototype . initConfig = function ( input , callback ) {
106109
107110 var self = this ;
111+
108112 if ( Typpy ( input , Function ) ) {
109113 callback = input ;
110114 input = null ;
Original file line number Diff line number Diff line change 11{
22 "name" : " git-stats" ,
3- "version" : " 2.6 .0" ,
3+ "version" : " 2.7 .0" ,
44 "description" : " Local git statistics including GitHub-like contributions calendars." ,
55 "main" : " lib/index.js" ,
66 "bin" : {
You can’t perform that action at this time.
0 commit comments