summaryrefslogtreecommitdiff
path: root/mappings.js
blob: e5a3f316c5f7282380714edb00af4fc42b705121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/node
"use strict";

const mappings_source = require("./mappings_source.js"),
    mappings = new Map(Object.entries(mappings_source));

for (let entry of new Set(Object.values(mappings_source))) {
    // add clean name -> clean name
    mappings.set(entry, entry);
}

module.exports = {
    map: mappings,
    // TODO wtf?
    isItem: (str) => str.indexOf("Item") != -1,
    isAbility: (str) => {
        if ( str.indexOf("Item") == -1 &&
        (str.indexOf("Ability") != -1 ||
            str.indexOf("ABILITY") != -1) ) {
            if (!mappings.has(str)) console.error(str);
            return true
        } return false; },
    isHero: (str) => str.indexOf("*") != -1 && str.indexOf("Item") == -1
};