@@ -15,10 +15,9 @@ import { defaultLocalize } from './utils';
1515// eslint-disable-next-line @typescript-eslint/no-explicit-any
1616// let enumExtensions: any;
1717/**
18- * **EN:** Generate an enum collection, the enum value supports `number` and `string` types, and the
19- * enum name supports localization solutions
20- *
21- * **CN:** 生成一个枚举集合,枚举值支持`number`和`string`类型,枚举名称支持本地化方案
18+ * - **EN:** Generate an enum collection, the enum value supports `number` and `string` types, and the
19+ * enum name supports localization solutions
20+ * - **CN:** 生成一个枚举集合,枚举值支持`number`和`string`类型,枚举名称支持本地化方案
2221 *
2322 * @example
2423 * const Week = Enum({
@@ -36,9 +35,8 @@ export function Enum<
3635 V extends EnumValue = ValueTypeFromSingleInit < T [ K ] , K > ,
3736> ( init : T , options ?: EnumInitOptions < T , K , V > ) : IEnum < T , K , V > & EnumExtension < T , K , V > ;
3837/**
39- * **EN:** Generate an enum based on an object array
40- *
41- * **CN:** 基于对象数组生成枚举
38+ * - **EN:** Generate an enum based on an object array
39+ * - **CN:** 基于对象数组生成枚举
4240 *
4341 * @example
4442 * const Week = Enum([
@@ -72,27 +70,25 @@ export function Enum<
7270}
7371
7472/**
75- * **EN:** Global localization function, used to convert enum item text to localized text. Only need
76- * to be set once, effective globally. This method need to be set at the project entry, before
77- * running any Enum instance
73+ * - **EN:** Global localization function, used to convert enum item text to localized text. Only need
74+ * to be set once, effective globally. This method need to be set at the project entry, before
75+ * running any Enum instance
7876 *
7977 * If you want to provide a custom localization function, be sure to resolve and localize the
8078 * following built-in resources:
8179 *
8280 * - `enum-plus.options.all` => `All`
83- *
84- * **CN:** 全局本地化函数,用于把枚举项文本转换为本地化文本。只需要设置一次,全局生效。需要在项目入口处设置,且在运行任何Enum实例之前
81+ * - **CN:** 全局本地化函数,用于把枚举项文本转换为本地化文本。只需要设置一次,全局生效。需要在项目入口处设置,且在运行任何Enum实例之前
8582 *
8683 * 如果要提供自定义的本地化函数,请务必解析并本地化以下内置资源:
8784 *
8885 * - `enum-plus.options.all` => `All`
8986 */
9087Enum . localize = defaultLocalize ;
9188/**
92- * **EN:** Add global extension methods to the enum, and all enum instances will have these new
93- * extension methods
94- *
95- * **CN:** 为枚举增加全局扩展方法,所有枚举实例都会具有这些新扩展方法
89+ * - **EN:** Add global extension methods to the enum, and all enum instances will have these new
90+ * extension methods
91+ * - **CN:** 为枚举增加全局扩展方法,所有枚举实例都会具有这些新扩展方法
9692 *
9793 * @param obj Extension content, must be an object | 扩展内容,必须是一个对象
9894 */
@@ -103,10 +99,9 @@ Enum.extends = function (obj: Record<string, unknown> | undefined) {
10399 Object . assign ( EnumExtensionClass . prototype , obj ) ;
104100} ;
105101/**
106- * **EN:** Install a plugin that enhances the functionality of the Enum class by adding new methods
107- * or properties.
108- *
109- * **CN:** 安装一个插件,通过添加新的方法或属性来增强Enum类的功能
102+ * - **EN:** Install a plugin that enhances the functionality of the Enum class by adding new methods
103+ * or properties.
104+ * - **CN:** 安装一个插件,通过添加新的方法或属性来增强Enum类的功能
110105 *
111106 * @param plugin The plugin to install | 要安装的插件
112107 * @param options The options for the plugin | 插件的选项
@@ -139,10 +134,9 @@ function getInitMapFromArray<
139134}
140135
141136/**
142- * **EN:** Represent the Enum plugin that enhances the functionality of the global Enum by adding
143- * new methods or properties.
144- *
145- * **CN:** 表示增强Enum类功能的插件,通过添加新方法或属性
137+ * - **EN:** Represent the Enum plugin that enhances the functionality of the global Enum by adding
138+ * new methods or properties.
139+ * - **CN:** 表示增强Enum类功能的插件,通过添加新方法或属性
146140 *
147141 * @param options The options for the plugin | 插件的选项
148142 * @param Enum The Enum global method | Enum全局方法
0 commit comments