Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bundle-stats/utils

Package Overview
Dependencies
Maintainers
1
Versions
481
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bundle-stats/utils - npm Package Compare versions

Comparing version 1.10.0 to 1.11.0-beta.0

14

lib-esm/metrics/get-metric-type.js

@@ -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,
};
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc