Skip to content

Commit

Permalink
chore(build): bundle library for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMaruchu committed Sep 13, 2019
1 parent 361f902 commit ea7374b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 50 deletions.
29 changes: 4 additions & 25 deletions es/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,27 +809,6 @@ const normalizeTime = time => {
return parseMs(averageTime);
};

/**
* @function
* @name normalizeObjectTimes
* @description Normalize times in a provided object (item)
*
* @param {object} item Object with times to be normalized
* @returns {object} Object with averageResolve time and averageAttend Time parse
*
* @version 0.1.0
* @since 0.2.0
*/
const normalizeObjectTimes = item => {
const normalizeObject = {};

normalizeObject.averageResolveTime = normalizeTime(item.averageResolveTime);

normalizeObject.averageAttendTime = normalizeTime(item.averageAttendTime);

return { ...item, ...normalizeObject };
};

/**
* @function
* @name normalizeMetricTimes
Expand Down Expand Up @@ -939,12 +918,12 @@ const prepareReportResponse = results => {
}

if (data.types) {
data.types = map(data.types, normalizeObjectTimes);
data.types = map(data.types, normalizeMetricTimes);
}

if (data.methods) {
data.methods = map(data.methods, normalizeObjectTimes);
}
// if (data.methods) {
// data.methods = map(data.methods, normalizeObjectTimes);
// }

return { ...defaultResults, data };
};
Expand Down
29 changes: 4 additions & 25 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -811,27 +811,6 @@ const normalizeTime = time => {
return parseMs(averageTime);
};

/**
* @function
* @name normalizeObjectTimes
* @description Normalize times in a provided object (item)
*
* @param {object} item Object with times to be normalized
* @returns {object} Object with averageResolve time and averageAttend Time parse
*
* @version 0.1.0
* @since 0.2.0
*/
const normalizeObjectTimes = item => {
const normalizeObject = {};

normalizeObject.averageResolveTime = normalizeTime(item.averageResolveTime);

normalizeObject.averageAttendTime = normalizeTime(item.averageAttendTime);

return { ...item, ...normalizeObject };
};

/**
* @function
* @name normalizeMetricTimes
Expand Down Expand Up @@ -941,12 +920,12 @@ const prepareReportResponse = results => {
}

if (data.types) {
data.types = lodash.map(data.types, normalizeObjectTimes);
data.types = lodash.map(data.types, normalizeMetricTimes);
}

if (data.methods) {
data.methods = lodash.map(data.methods, normalizeObjectTimes);
}
// if (data.methods) {
// data.methods = map(data.methods, normalizeObjectTimes);
// }

return { ...defaultResults, data };
};
Expand Down

0 comments on commit ea7374b

Please sign in to comment.