enum-plus has released a new version!
enum-plus v3.0 Released ๐

> Follow our public account to get timely delivery of technical insights!
The enum-plus v3.0 milestone upgrade is here โ a major version introducing new features, enhancements, and breaking changes.
๐ Full documentation: https://juejin.cn/post/7567630238701092902
โญ Star on GitHub: https://github.com/shijistar/enum-plus
---
๐ฅ Major New Features
1. Simplified Enum Initialization
No more `as const` needed in v3.0+.
// Before
const WeekEnum = Enum({
Monday: { value: 1, label: 'ๆๆไธ' },
Tuesday: { value: 2, label: 'ๆๆไบ' },
} as const);
// Now
const WeekEnum = Enum({
Monday: { value: 1, label: 'ๆๆไธ' },
Tuesday: { value: 2, label: 'ๆๆไบ' },
});---
2. `enum.named` โ Item Lookup by Key
Quickly access enum items without `.find()`.
const monday = WeekEnum.named.Monday;---
3. `enum.meta` โ Aggregate Custom Fields
Directly access custom field values for all members.
ColorEnum.meta.hex; // ['#FF0000', '#00FF00', '#0000FF']---
4. Updated `enum.values` Behavior
Returns raw member values, not objects.
Use `enum.items` for the old behavior.
WeekEnum.values; // [1, 2, 3, 4, 5, 6, 7]---
5. `enum.labels` โ Read-Only Label Array
WeekEnum.labels; // ['ๆๆไธ', 'ๆๆไบ', ...]---
6. `enum.toList` โ Unified List Conversion
Replaces `toSelect`, `toMenu`, and `toFilter` (now plugins).
WeekEnum.toList();
// [ { value: 1, label: 'Monday' }, { value: 2, label: 'Tuesday' } ]
WeekEnum.toList({ valueField: 'id', labelField: 'name' });
// [ { id: 1, name: 'Monday' }, { id: 2, name: 'Tuesday' } ]---
7. `enum.toMap` โ Key/Value Mapping
Replaces `enum.toValueMap`.
WeekEnum.toMap();
// { "1": 'Monday', "2": 'Tuesday' }
WeekEnum.toMap({ keySelector: 'key', valueSelector: 'value' });
// { "Monday": 1, "Tuesday": 2 }---
8. `Enum.isEnum` โ Instance Check
Enum.isEnum(WeekEnum); // true---
9. `enum.findBy` โ Search by Any Field
WeekEnum.findBy('value', 1);
WeekEnum.findBy('key', 'Monday');---
10. Improved `instanceof` Type Assertions
if (value instanceof WeekEnum) {
console.log(value); // type narrowed
}---
11. `Enum.install` โ Plugin Installation
Enum.install(plugin);---
12. Global Configuration via `Enum.config`
- `autoLabel` โ toggle automatic label generation
- `labelPrefix` โ set label prefix
---
โ Internal Changes
- Removed proxy in `EnumItemClass` โ replaced with getters (avoids circular references)
- Unified Jest & e2e tests
- Removed `private member` syntax (serialization friendly)
- Dropped warning for modified enum items
---
๐ฆ Plugin System
Now supports modular expansions via npm:
- `@enum-plus/plugin-antd` โ Ant Design bindings (`toSelect`, `toMenu`, etc.)
- `@enum-plus/plugin-i18next` โ i18next localization
- `@enum-plus/plugin-react-i18next` โ react-i18next support
- `@enum-plus/plugin-react` โ React integration with language reactivity
- `@enum-plus/plugin-i18next-vue` โ Vue with i18next
- `@enum-plus/plugin-vue-i18n` โ Vue with vue-i18n
> ๐ก Missing a plugin? Refer to the Plugin Development Guide.
---
โ Breaking Changes
- `values` now returns raw values
- Symbol renames:
- `ENUM_COLLECTION` โ `IS_ENUM`
- `ENUM_ITEM` โ `IS_ENUM_ITEM`
- `ENUM_ITEMS` โ `IS_ENUM_ITEMS`
- `toSelect`, `toMenu`, `toFilter`, `toValueMap` moved to plugins
- Removed deprecated:
- `options`, `menus`, `filters`, `valuesEnum`
---
๐ Bug Fixes
- Fixed sourcemap parsing under `lib` folder

---
๐ Read original article:
---
> ๐ฌ Pro Tip for Teams:
> For streamlined multi-platform release notes or docs, consider AiToEarnๅฎ็ฝ โ an open-source AI content monetization platform that lets you generate, publish, and track updates across Douyin, Kwai, WeChat, Bilibili, Xiaohongshu, Facebook, Instagram, LinkedIn, Threads, YouTube, Pinterest, and X (Twitter).
> Explore AiToEarnๆๆกฃ and AIๆจกๅๆๅ for integration examples.
---
Would you like me to also prepare a concise Markdown changelog version of this so you can drop it straight into your GitHub releases page? That would make it more developer-friendly.