Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cedx/enum

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cedx/enum - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

3

CHANGELOG.md
# Changelog
This file contains highlights of what changes on each version of the [Enums for JS](https://github.com/cedx/enum.js) library.
## Version 1.1.0
- Non-scalar values are excluded from the iteration of enumerable properties.
## Version 1.0.0
- Initial release.

@@ -26,3 +26,7 @@ 'use strict';

for (let prop in typeDef) enumType[prop] = typeDef[prop];
for (let prop in typeDef) {
let type = typeof typeDef[prop];
if (type == 'boolean' || type == 'number' || type == 'string') enumType[prop] = typeDef[prop];
}
return Object.freeze(enumType);

@@ -29,0 +33,0 @@ }

2

package.json

@@ -10,3 +10,3 @@ {

"repository": "cedx/enum.js",
"version": "1.0.0",
"version": "1.1.0",

@@ -13,0 +13,0 @@ "jsnext:main": "./src/index",

@@ -10,3 +10,3 @@ # Enums for JS

The latest [Node.js](https://nodejs.org) and [NPM](https://www.npmjs.com) versions.
If you plan to play with the sources, you will also need the [Gulp.js](http://gulpjs.com/) latest version.
If you plan to play with the sources, you will also need the latest [Gulp.js](http://gulpjs.com/) version.

@@ -23,3 +23,3 @@ ## Installing via [npm](https://www.npmjs.com)

### Create the enumeration
Just use the `Enum.create()` method on an object literal:
Just use the `Enum.create()` method with an object literal containing scalar values:

@@ -46,6 +46,4 @@ ```javascript

The created class has a constructor throwing an `Error`: it prohibits its instantiation. Thus, the obtained enumeration can only contain static members. You should only use named constants as its source values.
The created class has a constructor throwing an `Error`: it prohibits its instantiation. This class is also freezed to prevent any attempt at modifying its shape.
The enumeration is also freezed to prevent any attempt at modifying its shape.
### Work with the enumeration

@@ -52,0 +50,0 @@ Check whether a value is defined among the enumerated type:

@@ -21,3 +21,7 @@ /**

for (let prop in typeDef) enumType[prop] = typeDef[prop];
for (let prop in typeDef) {
let type = typeof typeDef[prop];
if (type == 'boolean' || type == 'number' || type == 'string') enumType[prop] = typeDef[prop];
}
return Object.freeze(enumType);

@@ -24,0 +28,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