New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

enum

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enum - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

enum-0.2.5.js

8

lib/enum.js

@@ -116,3 +116,3 @@ (function (root, module, global, define) {

var e = self.enums[i];
if (!((e.value !== 0) && !(e.value & (e.value - 1)))) {

@@ -167,3 +167,7 @@ return false;

if (key instanceof EnumItem || (typeof(key) === 'object' && key.key !== undefined && key.value !== undefined)) {
return key;
var foundIndex = this.enums.indexOf(key);
if (foundIndex >= 0) {
return key;
}
return null;
} else if (typeof(key) === 'string') {

@@ -170,0 +174,0 @@ if (key.indexOf(this._options.separator) > 0) {

{
"author": "adrai",
"name": "enum",
"version": "0.2.4",
"version": "0.2.5",
"private": false,

@@ -6,0 +6,0 @@ "main": "index.js",

@@ -385,4 +385,18 @@ var expect = expect || require('expect.js'),

describe('and getting an item of it from an other enum', function () {
it('it should return null', function() {
var myEnum1 = new e(['A', 'B', 'C']);
var myEnum2 = new e({'A': 1, 'B': 2, 'C': 4});
expect(myEnum2.get(myEnum1.A)).to.eql(null);
});
});
});
});
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