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

enumerated-type

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enumerated-type - npm Package Compare versions

Comparing version 0.5.16 to 0.5.18

56

index.js

@@ -169,5 +169,5 @@ 'use strict';

if (displayKeyName !== UNDEFINED) {
dropdownValues.push({value:value[keyName], label: value[displayKeyName]})
dropdownValues.push({value: value[keyName], label: value[displayKeyName]});
} else {
dropdownValues.push({value:value[keyName], label: name })
dropdownValues.push({value: value[keyName], label: name});
}

@@ -184,5 +184,5 @@ } else {

if (displayKeyName !== UNDEFINED) {
dropdownValues.push({value:value, label: value[displayKeyName]})
dropdownValues.push({value: value, label: value[displayKeyName]});
} else {
dropdownValues.push({value:value, label: name })
dropdownValues.push({value: value, label: name});
}

@@ -241,2 +241,26 @@ }

if (keyName !== UNDEFINED) {
Object.defineProperty(this, 'dropdownChoicesExcluding', {
value: function () {
if (arguments.length === 0) return dropdownValues;
let result = [];
const exclude = {};
forEach.call(arguments, (arg) => {
const item = this.value(arg);
if (item) exclude[item[keyName]] = true;
});
forEach.call(dropdownValues, (item) => {
if (!exclude.hasOwnProperty(item.value)) {
result.push(item);
}
});
return result;
},
writable: false,
enumerable: true,
});
const enumKeys = enumValues.map(value => value[keyName]);

@@ -275,2 +299,26 @@ Object.freeze(enumKeys);

} else {
Object.defineProperty(this, 'dropdownChoicesExcluding', {
value: function () {
if (arguments.length === 0) return dropdownValues;
let result = [];
const exclude = {};
forEach.call(arguments, (arg) => {
const item = this.value(arg);
if (item) exclude[item.value] = true;
});
forEach.call(dropdownValues, (item) => {
if (!exclude.hasOwnProperty(item.value)) {
result.push(item);
}
});
return result;
},
writable: false,
enumerable: true,
});
const enumKeys = enumValues.map(value => value.value);

@@ -277,0 +325,0 @@ Object.defineProperty(this, 'keys', {

2

package.json
{
"name": "enumerated-type",
"version": "0.5.16",
"version": "0.5.18",
"description": "enum type for javascript",

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

@@ -5,2 +5,3 @@ # Version History

- [0.5.18](#0518)
- [0.5.16](#0516)

@@ -21,2 +22,7 @@ - [0.5.14](#0514)

## 0.5.18
* Add: `dropdownChoicesExcluding(vararg exclude)` to return choices array but without the
choices for the given enum items in the choice list
## 0.5.16

@@ -23,0 +29,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