UNPKG

@enum-plus/plugin-antd

Version:

A plugin for enum-plus that provides functionality to bind enums to Ant Design

17 lines (16 loc) 448 B
// eslint-disable-next-line @typescript-eslint/no-empty-interface var toValueMapPlugin = function toValueMapPlugin(options, Enum) { Enum.extends({ toValueMap: function toValueMap() { var itemsMap = {}; this.items.forEach(function (item) { itemsMap[item.value] = { text: item.label }; }); return itemsMap; } }); }; export default toValueMapPlugin; //# sourceMappingURL=toValueMap.js.map