d2-charts-api
Advanced tools
Comparing version 27.0.6 to 27.0.7
@@ -11,14 +11,7 @@ 'use strict'; | ||
var ids = metaData.dimensions[dimensionName]; | ||
var categories = void 0; | ||
var dimensionIds = (0, _isArray2.default)(metaData.dimensions[dimensionName]) ? metaData.dimensions[dimensionName] : []; | ||
if ((0, _isArray2.default)(ids) && ids.length) { | ||
categories = []; | ||
ids.forEach(function (id) { | ||
categories.push(metaData.items[id].name); | ||
}); | ||
} | ||
return categories; | ||
return dimensionIds.map(function (id) { | ||
return metaData.items[id].name; | ||
}); | ||
}; | ||
@@ -31,2 +24,18 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
; | ||
/* | ||
let categories; | ||
if (isArray(ids) && ids.length) { | ||
categories = []; | ||
ids.forEach(id => { | ||
categories.push(metaData.items[id].name); | ||
}); | ||
} | ||
return categories; | ||
*/ | ||
//# sourceMappingURL=getCategories.js.map |
{ | ||
"name": "d2-charts-api", | ||
"version": "27.0.6", | ||
"version": "27.0.7", | ||
"description": "DHIS2 charts api", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,14 +7,20 @@ import isArray from 'd2-utilizr/lib/isArray'; | ||
const ids = metaData.dimensions[dimensionName]; | ||
let categories; | ||
const dimensionIds = isArray(metaData.dimensions[dimensionName]) ? metaData.dimensions[dimensionName] : []; | ||
if (isArray(ids) && ids.length) { | ||
categories = []; | ||
return dimensionIds.map(id => metaData.items[id].name); | ||
}; | ||
ids.forEach(id => { | ||
categories.push(metaData.items[id].name); | ||
}); | ||
} | ||
return categories; | ||
/* | ||
let categories; | ||
if (isArray(ids) && ids.length) { | ||
categories = []; | ||
ids.forEach(id => { | ||
categories.push(metaData.items[id].name); | ||
}); | ||
} | ||
return categories; | ||
*/ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
172854
2563