Huge News!Announcing our $40M Series B led by Abstract Ventures.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 1.1.0 to 2.0.0

enum-2.0.0.js

8

lib/enum.js

@@ -192,4 +192,2 @@ "use strict";

return item.key;
} else {
return 'Undefined';
}

@@ -207,4 +205,2 @@ },

return item.value;
} else {
return null;
}

@@ -219,3 +215,3 @@ },

get: function(key, offset) {
if (key === null || key === undefined) return null;
if (key === null || key === undefined) return;

@@ -233,3 +229,3 @@ // Buffer instance support, part of the ref Type interface

if (!this.isFlaggable || (this.isFlaggable && key.key.indexOf(this._options.separator) < 0)) {
return null;
return;
}

@@ -236,0 +232,0 @@ return this.get(key.key);

{
"author": "adrai",
"name": "enum",
"version": "1.1.0",
"version": "2.0.0",
"private": false,

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

@@ -18,4 +18,4 @@ # Introduction

|:------------|:----------------|:---------|
| `enum-1.1.0.js` | *uncompressed, with comments* | [Download](https://raw.github.com/adrai/enum/master/enum-1.1.0.js) |
| `enum-1.1.0.min.js` | *compressed, without comments* | [Download](https://raw.github.com/adrai/enum/master/enum-1.1.0.min.js) |
| `enum-2.0.0.js` | *uncompressed, with comments* | [Download](https://raw.github.com/adrai/enum/master/enum-2.0.0.js) |
| `enum-2.0.0.min.js` | *compressed, without comments* | [Download](https://raw.github.com/adrai/enum/master/enum-2.0.0.min.js) |

@@ -22,0 +22,0 @@ # Installation (node.js)

@@ -27,3 +27,3 @@ var expect = expect || require('expect.js'),

it('it should be tha same', function() {
it('it should be the same', function() {

@@ -220,9 +220,15 @@ myEnum = new e(['A', 'B', 'C']);

});
describe('undefined', function() {
describe('call get with null and get', function() {
it('for null', function() {
expect(myEnum.get(null)).to.be(undefined);
});
it('null', function() {
it('for undefined', function() {
expect(myEnum.get(undefined)).to.be(undefined);
});
expect(myEnum.get(null)).to.eql(null);
it('for invalid key/value', function() {
expect(myEnum.get('X')).to.be(undefined);
});

@@ -233,12 +239,3 @@ });

describe('call get with undefined and get', function() {
it('null', function() {
expect(myEnum.get(undefined)).to.eql(null);
});
});
describe('call getValue and get', function() {

@@ -270,2 +267,18 @@

describe('undefined', function() {
it('for null', function() {
expect(myEnum.getValue(null)).to.be(undefined);
});
it('for undefined', function() {
expect(myEnum.getValue(undefined)).to.be(undefined);
});
it('for invalid key/value', function() {
expect(myEnum.getValue('X')).to.be(undefined);
});
});
});

@@ -299,2 +312,17 @@

describe('undefined', function() {
it('for null', function() {
expect(myEnum.getKey(null)).to.be(undefined);
});
it('for undefined', function() {
expect(myEnum.getKey(undefined)).to.be(undefined);
});
it('for invalid key/value', function() {
expect(myEnum.getKey('X')).to.be(undefined);
});
});
});

@@ -415,3 +443,3 @@

describe('beeing flagged', function() {
describe('being flagged', function() {

@@ -434,3 +462,3 @@ var myFlaggedEnum;

describe('not beeing flagged', function() {
describe('not being flagged', function() {

@@ -455,3 +483,3 @@ var myNonFlaggedEnum;

expect(myNonFlaggedEnum.get(5)).to.not.be.ok();
expect(myNonFlaggedEnum.get(5)).to.be(undefined);

@@ -462,27 +490,7 @@ });

describe('call get with an non valid value and get', function() {
it('null', function() {
expect(myNonFlaggedEnum.get(12345)).to.eql(null);
});
});
describe('call get with 0 and get', function() {
it('null', function() {
expect(myNonFlaggedEnum.get(0)).to.not.eql(null);
});
});
});
describe('and getting an item of it from an other enum', function () {
describe('and getting an item of it from another enum', function () {
it('it should return null', function() {
it('it should return undefined', function() {

@@ -493,3 +501,3 @@ var myEnum1 = new e(['A', 'B', 'C']);

expect(myEnum2.get(myEnum1.A)).to.eql(null);
expect(myEnum2.get(myEnum1.A)).to.be(undefined);

@@ -542,3 +550,3 @@ });

describe('beeing not case sensitive', function() {
describe('being not case sensitive', function() {

@@ -545,0 +553,0 @@ var myEnum = new e(['One', 'tWo', 'ThrEE'], { ignoreCase: true });

Sorry, the diff of this file is not supported yet

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