@@ -12,8 +12,8 @@ const pkg = require('../package.json');
1212 * When the fetched version is greater than the given one, the newer version
1313 * is returned.
1414 *
15- * @param options {object} The options for the version check.
16- * @param callback {function|undefined} The callback function.
15+ * @param { CheckOptions } options The options for the version check.
16+ * @param { CallbackFunction } callback The callback function.
1717 */
1818const graphql = ( options , callback ) => {
1919 // build the query
@@ -46,10 +46,11 @@ const graphql = (options, callback) => {
4646 * When the fetched version is greater than the given one, the newer version
4747 * is returned.
4848 *
49- * @param options {object} The options for the version check.
50- * @param callback {function|undefined} The callback function.
49+ * @param { CheckOptions } options The options for the version check.
50+ * @param { CallbackFunction } callback The callback function.
5151*/
5252const rest = ( options , callback ) => {
53+ /** @type {RestHandlerFunction } */
5354 const handler = res => {
5455 const chunks = [ ] ;
5556 res . on ( 'data' , chunk => {
@@ -115,6 +116,7 @@ const rest = (options, callback) => {
115116 }
116117
117118 // define request options
119+ /** @type {https.RequestOptions } */
118120 const opts = {
119121 hostname : 'api.github.com' ,
120122 path : apiUrl ,
@@ -137,8 +139,8 @@ const rest = (options, callback) => {
137139 * Github GraphQL API (v4) will be used. Otherwise we rely on the Github Rest API (v3), which
138140 * does not require authentication.
139141 *
140- * @param options {object} The options for the version check.
141- * @param callback {function|undefined} The callback function.
142+ * @param { CheckOptions } options The options for the version check.
143+ * @param { CallbackFunction } callback The callback function.
142144 */
143145module . exports = ( options , callback ) => {
144146 if ( options === null || options === undefined ) {
0 commit comments