@metrics/metric
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -79,6 +79,10 @@ 'use strict'; | ||
const validLabel = (value) => { | ||
if (!value.name || !value.value) { | ||
if (typeof value !== 'object') { | ||
return false; | ||
} | ||
if (!('name' in value) || !('value' in value)) { | ||
return false; | ||
} | ||
if (!REGEX_NAME.test(value.name)) { | ||
@@ -102,6 +106,6 @@ return false; | ||
const valid = value.filter(validLabel).length; | ||
const valid = value.filter(validLabel); | ||
return (value.length === valid); | ||
return (value.length === valid.length); | ||
}; | ||
module.exports.validLabels = validLabels; |
{ | ||
"name": "@metrics/metric", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "The metric class definition which metric objects in the @metrics library is instansiated from", | ||
@@ -5,0 +5,0 @@ "main": "lib/metric.js", |
12465
179