Skip to content

Commit

Permalink
chore(build): bundle library for v0.8.3 and update package version
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMaruchu committed Jun 8, 2020
1 parent 5ab1bf2 commit c61ff21
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
16 changes: 9 additions & 7 deletions es/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { connect } from '@lykmapipo/mongoose-common';
import { mount } from '@lykmapipo/express-common';
import { Router, start as start$1 } from '@lykmapipo/express-rest-actions';
import { createModels } from '@lykmapipo/file';
import { isFunction, map, sortBy, uniqBy, mapValues, endsWith } from 'lodash';
import { isFunction, slice, map, sortBy, uniqBy, mapValues, endsWith } from 'lodash';
import { waterfall, parallel } from 'async';
import { Party } from '@codetanzania/emis-stakeholder';
import { DEFAULT_PREDEFINE_RELATION } from '@codetanzania/ewea-common';
Expand Down Expand Up @@ -1450,11 +1450,11 @@ const AGE_GROUPS_LOWER_BOUNDARIES = [
160,
];

// generate all age groups from 0 to 200 years
// For shaping returned value
const NORMALIZED_AGE_GROUPS = map(
AGE_GROUPS_LOWER_BOUNDARIES,
(lowerBoundary) => {
// generate all age groups from 0 to 159 years
// Remove the last range 160 - 169 since it is not included in $buckets
// shape returned values to have a common structure for all ranges
const NORMALIZED_AGE_GROUPS = slice(
map(AGE_GROUPS_LOWER_BOUNDARIES, (lowerBoundary) => {
const upperBoundary =
lowerBoundary === 'Other' ? 'Other' : lowerBoundary + 9; // account for difference i.e 30 - 39
return {
Expand All @@ -1463,7 +1463,9 @@ const NORMALIZED_AGE_GROUPS = map(
lowerBoundary,
upperBoundary,
};
}
}),
0,
AGE_GROUPS_LOWER_BOUNDARIES.length - 1
);

const CASE_AGGREGATION_EXCLUDE = [];
Expand Down
14 changes: 8 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1452,11 +1452,11 @@ const AGE_GROUPS_LOWER_BOUNDARIES = [
160,
];

// generate all age groups from 0 to 200 years
// For shaping returned value
const NORMALIZED_AGE_GROUPS = lodash.map(
AGE_GROUPS_LOWER_BOUNDARIES,
(lowerBoundary) => {
// generate all age groups from 0 to 159 years
// Remove the last range 160 - 169 since it is not included in $buckets
// shape returned values to have a common structure for all ranges
const NORMALIZED_AGE_GROUPS = lodash.slice(
lodash.map(AGE_GROUPS_LOWER_BOUNDARIES, (lowerBoundary) => {
const upperBoundary =
lowerBoundary === 'Other' ? 'Other' : lowerBoundary + 9; // account for difference i.e 30 - 39
return {
Expand All @@ -1465,7 +1465,9 @@ const NORMALIZED_AGE_GROUPS = lodash.map(
lowerBoundary,
upperBoundary,
};
}
}),
0,
AGE_GROUPS_LOWER_BOUNDARIES.length - 1
);

const CASE_AGGREGATION_EXCLUDE = [];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codetanzania/ewea-reports",
"version": "0.8.2",
"version": "0.8.3",
"description": "Common reports for EWEA",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down

0 comments on commit c61ff21

Please sign in to comment.