@nodeswork/utils
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -15,2 +15,3 @@ import { MetricsData, MetricsDimensions, MetricsValue, Operator } from './def'; | ||
getDimensions(data: MetricsData, strict?: boolean): MetricsDimensions[]; | ||
getDimensionValues(data: MetricsData | MetricsData[], name: string): any[]; | ||
getMetricsNames(data: MetricsData, strict?: boolean): string[]; | ||
@@ -17,0 +18,0 @@ filterMetricsDatas(data: MetricsData[], filter: MetricsDataFilter): MetricsData[]; |
@@ -147,2 +147,17 @@ "use strict"; | ||
} | ||
getDimensionValues(data, name) { | ||
if (_.isArray(data)) { | ||
return _.chain(data) | ||
.map((d) => this.getDimensionValues(d, name)) | ||
.flatten() | ||
.uniq() | ||
.value(); | ||
} | ||
else { | ||
return _.chain(data.dimensions) | ||
.map((dimensions) => dimensions[name]) | ||
.uniq() | ||
.value(); | ||
} | ||
} | ||
getMetricsNames(data, strict = false) { | ||
@@ -149,0 +164,0 @@ if (!strict) { |
{ | ||
"name": "@nodeswork/utils", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Utilities used across nodeswork repos.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
55436
1052