Skip to content

Commit

Permalink
Corrected lint errors in lib commons 👕
Browse files Browse the repository at this point in the history
  • Loading branch information
kunagpal committed Jul 16, 2018
1 parent 1cbdc47 commit ebd57e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/common/v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var _ = require('lodash').noConflict(),

regexes = {
fold: /\r\n([ \t])/g,
trim: /^\s*(.*\S)?\s*$/,
header: /^((\/\/\s*)?\S+):(.*)$/gm
trim: /^\s*(.*\S)?\s*$/, // eslint-disable-line security/detect-unsafe-regex
header: /^((\/\/\s*)?\S+):(.*)$/gm // eslint-disable-line security/detect-unsafe-regex
},
headersCommentPrefix = '//';

Expand All @@ -26,7 +26,7 @@ module.exports = {
* @param {String} data - A string of newline concatenated header key-value pairs.
* @param {?Boolean} [legacy] - A flag to indicate whether the parsing is being done for v1 normalization or v1 to
* v2 conversion.
* @returns {Object[]} - The parsed list of header key-value pair objects.
* @returns {Object[]|*} - The parsed list of header key-value pair objects.
* @private
*/
parseHeaders: function (data, legacy) {
Expand Down
5 changes: 4 additions & 1 deletion lib/common/v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var _ = require('lodash').noConflict(),
* Replenishes missing ids in v2.0.0.x collections.
*
* @param {*} currentItem - A collection entity on which to check for ids.
* @returns {*} - The updated item, with the correct id fields in place.
* @returns {Object|*} - The updated item, with the correct id fields in place.
*/
populateIds = function (currentItem) {
if (!currentItem) { return; }
Expand All @@ -15,10 +15,13 @@ var _ = require('lodash').noConflict(),
currentItem.id = currentItem._postman_id;
delete currentItem._postman_id;
}

!currentItem.id && (currentItem.id = util.uid());

var itemArray = currentItem.items || currentItem.item;

itemArray && itemArray.length && _.forEach(itemArray, populateIds);

return currentItem;
};

Expand Down

0 comments on commit ebd57e7

Please sign in to comment.