Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
A few JSDoc fixes. (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 10, 2019
1 parent 483e080 commit 229eac4
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/fetchResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const upgradeToHttps = require('./upgradeToHttps');
/**
* Download the resource
*
* @param {string} resourceUrl
* @param {string} resourceUrl - The URL to fetch
* @param {Function} cb - callback
* @return {Object.XMLHttpRequest} request object
*/
Expand Down
3 changes: 3 additions & 0 deletions lib/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ const fetchResource = require('./fetchResource');
/**
* Generate SRI data for a resource
*
* @param {Array} options - Options Object
* @param {Array} options.algorithms - List of desired hash algorithms
* @param {string} options.url - Resource URL
* @param {Function} cb - callback
* @return {Function.cb}
*/
const generate = (options, cb) => {
if (typeof options.algorithms === 'string') {
Expand Down
4 changes: 2 additions & 2 deletions lib/generateElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const generate = require('./generate');
* Wrap SRI data for resourceUrl in a script tag
*
* @deprecated pending move to isomorphic app
* @param {string} resourceUrl
* @param {Array} algorithms
* @param {string} resourceUrl - Resource URL
* @param {Array} algorithms - The desired hash algorithms
* @param {Function} cb - callback
*/
const generateElement = (resourceUrl, algorithms, cb) => {
Expand Down
1 change: 1 addition & 0 deletions lib/guessResourceType.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const resourceTypes = require('./data/resourceTypes');
/**
* Figure out what type of resource the user is requesting.
*
* @param {Object} resource - resource object
* @param {string} resource.ct - content-type
* @param {string} resource.url - URL
* @return {string} assumed file extension
Expand Down
2 changes: 1 addition & 1 deletion lib/moduleForProtocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { URL } = require('url');
/**
* Choose corresponding module (http or https) for downloading a resource.
*
* @param {string} urlString
* @param {string} urlString - Input URL
* @return {Object} http or https module
*/
const moduleForProtocol = (urlString) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/processResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const eligibility = require('./eligibility');
*
* @param {string} data
* @param {Object} response
* @param {string} resourceUrl
* @param {string} resourceUrl - Resource URL
* @param {Function} cb - callback
* @return {Function.cb}
*/
Expand Down
3 changes: 3 additions & 0 deletions lib/shuffleArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
* Shuffle the elements of the array.
*
* https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array
*
* @param {Array} oldArray - The input Array
* @return {Array} The new shuffled Array
*/
const shuffleArray = (oldArray) => {
const array = oldArray.slice(0);
Expand Down
2 changes: 1 addition & 1 deletion lib/upgradeToHttps.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const secureHosts = require('./data/secureHosts');
/**
* Upgrade the given URL to HTTPS, if it's from a host believed to support it.
*
* @param {string} urlString
* @param {string} urlString - Input URL
* @return {string} processed URL
*/
const upgradeToHttps = (urlString) => {
Expand Down

0 comments on commit 229eac4

Please sign in to comment.