isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
20 lines (19 loc) • 862 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.COLLECTIBLE_NAME_TO_TYPE_MAP = void 0;
const string_1 = require("../functions/string");
const collectibleNames_1 = require("../objects/collectibleNames");
/**
* Maps collectible names to the values of the `CollectibleType` enum.
*
* For a mapping of `CollectibleType` to name, see the `COLLECTIBLE_NAMES` constant.
*/
exports.COLLECTIBLE_NAME_TO_TYPE_MAP = (() => {
const collectibleNameToTypeMap = new Map();
for (const [collectibleTypeString, name] of Object.entries(collectibleNames_1.COLLECTIBLE_NAMES)) {
const collectibleType = collectibleTypeString;
const simpleString = (0, string_1.removeNonAlphanumericCharacters)(name);
collectibleNameToTypeMap.set(simpleString, collectibleType);
}
return collectibleNameToTypeMap;
})();