enum-plus
Version:
A drop-in replacement for native enum. Like native enum but much better!
71 lines • 3.61 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultLocalize = exports.IS_ENUM_ITEMS = exports.IS_ENUM = exports.IS_ENUM_ITEM = exports.NAMED = exports.META = exports.ENUM_OPTIONS = exports.RAW = exports.LABELS = exports.VALUES = exports.KEYS = exports.ITEMS = void 0;
/**
* - **EN:** Alias of `items`. If the enum contains a field with the same name as `items`, you can
* access it by this Symbol as the field name
* - **CN:** 枚举`items`集合的别名。如果枚举中包含了`items`的同名字段,可以通过此Symbol作为字段名来访问
*/
exports.ITEMS = Symbol.for('[items]');
/**
* - **EN:** Alias of `keys`. If the enum contains a field with the same name as `keys`, you can
* access it by this Symbol as the field name
* - **CN:** 枚举keys集合的别名。如果枚举中包含了`keys`的同名字段,可以通过此Symbol作为字段名来访问
*/
exports.KEYS = Symbol.for('[keys]');
/**
* - **EN:** Alias of `values`. If the enum contains a field with the same name as `values`, you can
* access it by this Symbol as the field name
* - **CN:** 枚举values集合的别名。如果枚举中包含了`values`的同名字段,可以通过此Symbol作为字段名来访问
*/
exports.VALUES = Symbol.for('[values]');
/**
* - **EN:** Alias of `labels`. If the enum contains a field with the same name as `labels`, you can
* access it by this Symbol as the field name
* - **CN:** 枚举labels集合的别名。如果枚举中包含了`labels`的同名字段,可以通过此Symbol作为字段名来访问
*/
exports.LABELS = Symbol.for('[labels]');
/**
* - **EN:** Alias of `raw`. If the enum contains a field with the same name as `raw`, you can access
* it by this Symbol as the field name
* - **CN:** 枚举raw集合的别名。如果枚举中包含了`raw`的同名字段,可以通过此Symbol作为字段名来访问
*/
exports.RAW = Symbol.for('[raw]');
exports.ENUM_OPTIONS = Symbol.for('[EnumOptions]');
/**
* - **EN:** Alias of `meta`. If the enum contains a field with the same name as `meta`, you can
* access it by this Symbol as the field name
* - **CN:** 枚举`meta`集合的别名。如果枚举中包含了`meta`的同名字段,可以通过此Symbol作为字段名来访问
*/
exports.META = Symbol.for('[meta]');
/**
* - **EN:** Alias of `named`. If the enum contains a field with the same name as `named`, you can
* access it by this Symbol as the field name
* - **CN:** 枚举`named`集合的别名。如果枚举中包含了`named`的同名字段,可以通过此Symbol作为字段名来访问
*/
exports.NAMED = Symbol.for('[named]');
/**
* - **CN:** 判断对象是否 `EnumItem` 实例
* - **EN:** Check whether the object is an `EnumItem` instance
*/
exports.IS_ENUM_ITEM = Symbol.for('[IsEnumItem]');
/**
* - **EN:** Check whether the object is an enum type
* - **CN:** 判断对象是否枚举类型
*/
exports.IS_ENUM = Symbol.for('[IsEnum]');
/**
* - **EN:** Check whether the object is an `EnumItems` collection array
* - **CN:** 判断对象是否 `EnumItems` 集合数组
*/
exports.IS_ENUM_ITEMS = Symbol.for('[IsEnumItems]');
/**
* - **EN:** Default global localization function, only used to resolve built-in resources into
* English, does not provide actual localization functions
* - **CN:** 默认的全局本地化函数,仅用于将内置资源解析为英文,并不提供实际的本地化功能
*/
const defaultLocalize = (content) => {
return content;
};
exports.defaultLocalize = defaultLocalize;
//# sourceMappingURL=utils.js.map