You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,18 @@
14
14
- 🔥 introduce an official plugin `enum-plus-plugin` that provides a collection of highly shareable plugins.
15
15
- These plugins are designed to work in all scenarios and environments (including browser and Node.js), without introducing dependencies on third-party frameworks, component libraries, or platforms.
16
16
- If you have a good idea that might be specific to a certain framework or platform rather than universally applicable, we recommend creating a new plugin project (e.g., `enum-plus-plugin-xxx`). We are happy to see that, and hope that you submit a PR to `enum-plus-plugin` to link your project back.
17
+
- 🛠 Add `const` modifier to Enum function to simplify the enum initialization. Inline initializations no longer requires `as const`. Thanks to @otomad.
18
+
19
+
```diff
20
+
import { Enum } from 'enum-plus';
21
+
22
+
const MyEnum = Enum({
23
+
Foo: 1,
24
+
Bar: 2,
25
+
- } as const);
26
+
+ });
27
+
```
28
+
17
29
- ✨ Introduced **UMD module format** support, enabling direct browser usage without requiring a module bundler. Two variants are now available:
18
30
19
31
-`enum-plus.min.js` (ES2020) optimized for modern browsers.
0 commit comments