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

enum

Package Overview
Dependencies
Maintainers
2
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 2.3.0 to 2.4.0

enum-2.4.0.js

27

dist/enum.js

@@ -11,6 +11,11 @@ "use strict";

var isString = require("./isType").isString;
var _isType = require("./isType");
var isString = _isType.isString;
var isNumber = _isType.isNumber;
var indexOf = require("./indexOf").indexOf;
var isBuffer = _interopRequire(require("is-buffer"));
var endianness = os.endianness();

@@ -135,3 +140,3 @@

} // Buffer instance support, part of the ref Type interface
if (Buffer.isBuffer(key)) {
if (isBuffer(key)) {
key = key["readUInt32" + this._options.endianness](offset || 0);

@@ -271,2 +276,20 @@ }

/**
* Return true whether the enumItem parameter passed in is an EnumItem object and
* has been included as constant of this Enum
* @param {EnumItem} enumItem
*/
Enum.prototype.isDefined = function isDefined(enumItem) {
var condition = function (e) {
return e === enumItem;
};
if (isString(enumItem) || isNumber(enumItem)) {
condition = function (e) {
return e.is(enumItem);
};
}
return this.enums.some(condition);
};
/**
* Returns JSON object representation of this Enum.

@@ -273,0 +296,0 @@ * @return {String} JSON object representation of this Enum.

@@ -15,2 +15,6 @@ "use strict";

};
exports.isString = isString;
exports.isString = isString;
var isNumber = function (value) {
return isType("number", value);
};
exports.isNumber = isNumber;

6

package.json
{
"author": "adrai",
"name": "enum",
"version": "2.3.0",
"version": "2.4.0",
"private": false,

@@ -13,3 +13,5 @@ "main": "index.js",

},
"dependencies": {},
"dependencies": {
"is-buffer": "^1.1.0"
},
"devDependencies": {

@@ -16,0 +18,0 @@ "expect.js": ">= 0.1.2",

@@ -24,4 +24,4 @@ # Introduction

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

@@ -154,5 +154,2 @@ # Installation (node.js)

// or
myEnum.A == 'A'
// or
myEnum.A == myEnum.A

@@ -159,0 +156,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