Comparing version 0.2.5 to 0.2.6
@@ -170,3 +170,6 @@ (function (root, module, global, define) { | ||
} | ||
return null; | ||
if (!this.isFlaggable || (this.isFlaggable && key.key.indexOf(this._options.separator) < 0)) { | ||
return null; | ||
} | ||
return this.get(key.key); | ||
} else if (typeof(key) === 'string') { | ||
@@ -173,0 +176,0 @@ if (key.indexOf(this._options.separator) > 0) { |
{ | ||
"author": "adrai", | ||
"name": "enum", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -15,4 +15,4 @@ # Introduction | ||
|:------------|:----------------|:---------| | ||
| `enum-0.2.4.js` | *uncompressed, with comments* | [Download](https://raw.github.com/adrai/enum/master/enum-0.2.4.js) | | ||
| `enum-0.2.4.min.js` | *compressed, without comments* | [Download](https://raw.github.com/adrai/enum/master/enum-0.2.4.min.js) | | ||
| `enum-0.2.6.js` | *uncompressed, with comments* | [Download](https://raw.github.com/adrai/enum/master/enum-0.2.6.js) | | ||
| `enum-0.2.6.min.js` | *compressed, without comments* | [Download](https://raw.github.com/adrai/enum/master/enum-0.2.6.min.js) | | ||
@@ -118,3 +118,3 @@ # Installation (node.js) | ||
Copyright (c) 2013 Adriano Raiano | ||
Copyright (c) 2014 Adriano Raiano | ||
@@ -121,0 +121,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -179,3 +179,3 @@ var expect = expect || require('expect.js'), | ||
it('get an enum item by item', function() { | ||
it('an enum item by item', function() { | ||
@@ -190,2 +190,11 @@ expect(myEnum.get(myEnum.A)).to.have.property('value', 1); | ||
it('an enum item by flagged item', function() { | ||
var item = myEnum.get('A | B'); | ||
expect(myEnum.get(item)).to.have.property('value', 3); | ||
expect(myEnum.get(item)).to.have.property('key', 'A | B'); | ||
}); | ||
it('an enum item by value', function() { | ||
@@ -192,0 +201,0 @@ |
Sorry, the diff of this file is not supported yet
31944
648