Skip to content

Commit 560fcd6

Browse files
committed
chore(tools): fix no-unnecessary-nested-functions lint error in factory.js
1 parent fe7601f commit 560fcd6

File tree

1 file changed

+10
-18
lines changed
  • lib/node_modules/@stdlib/_tools/github/create-repo/lib

1 file changed

+10
-18
lines changed

lib/node_modules/@stdlib/_tools/github/create-repo/lib/factory.js

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ function factory( options, clbk ) {
8080
if ( !isFunction( clbk ) ) {
8181
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );
8282
}
83-
return createRepo;
83+
84+
function done( error, data, info ) {
85+
error = error || null;
86+
data = data || null;
87+
info = info || null;
88+
clbk( error, data, info );
89+
}
8490

8591
/**
8692
* Creates a GitHub repository.
@@ -95,24 +101,10 @@ function factory( options, clbk ) {
95101
throw new TypeError( format( 'invalid argument. Repository name must be a string. Value: `%s`.', name ) );
96102
}
97103
query( name, opts, done );
98-
/**
99-
* Callback invoked after receiving an API response.
100-
*
101-
* @private
102-
* @param {(Error|null)} error - error object
103-
* @param {ObjectArray} data - query data
104-
* @param {Object} info - response info
105-
* @returns {void}
106-
*/
107-
function done( error, data, info ) {
108-
error = error || null;
109-
data = data || null;
110-
info = info || null;
111-
clbk( error, data, info );
112-
}
113-
}
114-
}
104+
}
115105

106+
return createRepo;
107+
}
116108

117109
// EXPORTS //
118110

0 commit comments

Comments
 (0)