enumerated-type
Advanced tools
Comparing version 0.5.8 to 0.5.10
@@ -262,5 +262,5 @@ 'use strict'; | ||
// define property with value to return matching enumValue to the key | ||
// define function value to return matching enumValue to the key | ||
Object.defineProperty(this, 'value', { | ||
value: function (key) { | ||
value: function (key, defaultValue = UNDEFINED) { | ||
// allow values to be passed | ||
@@ -271,3 +271,3 @@ if (this.values.indexOf(key) !== -1) return key; | ||
if (enumValue.value === key) return BREAK(enumValue); | ||
}); | ||
}) || defaultValue; | ||
}, | ||
@@ -274,0 +274,0 @@ }); |
{ | ||
"name": "enumerated-type", | ||
"version": "0.5.8", | ||
"version": "0.5.10", | ||
"description": "enum type for javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
22486