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 0.1.0 to 0.2.0

enum-0.2.0.js

5

lib/enum.js

@@ -54,2 +54,4 @@ (function () {

this.enums = [];
if (map.length) {

@@ -65,6 +67,7 @@ var array = map;

for (var member in map) {
if ((this._options.name && member === 'name') || member === '_options' || member === 'get' || member === 'getKey' || member === 'getValue') {
if ((this._options.name && member === 'name') || member === '_options' || member === 'get' || member === 'getKey' || member === 'getValue' || member === 'enums') {
throw new Error('Enum key "' + member + '" is a reserved word!');
}
this[member] = new EnumItem(member, map[member]);
this.enums.push(this[member]);
}

@@ -71,0 +74,0 @@

2

package.json
{
"author": "adrai",
"name": "enum",
"version": "0.1.0",
"version": "0.2.0",
"private": false,

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

@@ -15,4 +15,4 @@ # Introduction

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

@@ -74,2 +74,6 @@ # Installation (node.js)

// get all items
myEnum.enums // returns all enums in an array
// compare

@@ -76,0 +80,0 @@ myEnum.A.is(myEnum.A)

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

describe('defining a simple enum', function() {
describe('defining an enum', function() {

@@ -53,2 +53,12 @@ var myEnum;

it('get all enum values', function() {
expect(myEnum.enums).to.be.an('array');
expect(myEnum.enums).to.have.length(3);
expect(myEnum.enums).to.contain(myEnum.A);
expect(myEnum.enums).to.contain(myEnum.B);
expect(myEnum.enums).to.contain(myEnum.C);
});
describe('call has', function() {

@@ -55,0 +65,0 @@

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