@bundle-stats/utils
Advanced tools
Comparing version 1.10.0 to 1.11.0-beta.0
@@ -27,9 +27,15 @@ "use strict"; | ||
const getMetricType = (key, type) => { | ||
const metric = (0, _get2.default)(_metrics.default, key, { | ||
label: key, | ||
type: type || _metrics.METRIC_TYPE_NUMERIC | ||
const metric = (0, _get2.default)(_metrics.default, key); | ||
if (metric && metric.type) { | ||
return _objectSpread({}, _metrics.METRIC_TYPES[metric.type], {}, metric); | ||
} | ||
const resolvedType = type || _metrics.METRIC_TYPE_NUMERIC; | ||
return _objectSpread({}, _metrics.METRIC_TYPES[resolvedType], { | ||
type: resolvedType, | ||
label: key | ||
}); | ||
return _objectSpread({}, _metrics.METRIC_TYPES[metric.type], {}, metric); | ||
}; | ||
exports.getMetricType = getMetricType; |
@@ -25,9 +25,15 @@ "use strict"; | ||
const getMetricType = (key, type) => { | ||
const metric = (0, _lodash.get)(_metrics.default, key, { | ||
label: key, | ||
type: type || _metrics.METRIC_TYPE_NUMERIC | ||
const metric = (0, _lodash.get)(_metrics.default, key); | ||
if (metric && metric.type) { | ||
return _objectSpread({}, _metrics.METRIC_TYPES[metric.type], {}, metric); | ||
} | ||
const resolvedType = type || _metrics.METRIC_TYPE_NUMERIC; | ||
return _objectSpread({}, _metrics.METRIC_TYPES[resolvedType], { | ||
type: resolvedType, | ||
label: key | ||
}); | ||
return _objectSpread({}, _metrics.METRIC_TYPES[metric.type], {}, metric); | ||
}; | ||
exports.getMetricType = getMetricType; |
{ | ||
"name": "@bundle-stats/utils", | ||
"version": "1.10.0", | ||
"version": "1.11.0-beta.0", | ||
"description": "BundleStats utils", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -6,11 +6,18 @@ import { get } from 'lodash'; | ||
export const getMetricType = (key, type) => { | ||
const metric = get(METRICS, key, { | ||
label: key, | ||
type: type || METRIC_TYPE_NUMERIC, | ||
}); | ||
const metric = get(METRICS, key); | ||
if (metric && metric.type) { | ||
return { | ||
...METRIC_TYPES[metric.type], | ||
...metric, | ||
}; | ||
} | ||
const resolvedType = type || METRIC_TYPE_NUMERIC; | ||
return { | ||
...METRIC_TYPES[metric.type], | ||
...metric, | ||
...METRIC_TYPES[resolvedType], | ||
type: resolvedType, | ||
label: key, | ||
}; | ||
}; |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
176402
4377
1