diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-11-11 17:18:44 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-11-11 17:18:44 +0100 |
| commit | 1110e15450e3949782f2ae5344c080cbe701886b (patch) | |
| tree | d2b821943b51d9064283c3819c96e7cb7ace4cf1 | |
| parent | d4fd1779feaa283f85983e5c5f68bd40f38ed82e (diff) | |
| download | orm-1110e15450e3949782f2ae5344c080cbe701886b.tar.gz orm-1110e15450e3949782f2ae5344c080cbe701886b.zip | |
add API mapping sanity check helper
| -rw-r--r-- | mappings.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mappings.js b/mappings.js index e5a3f31..5d9315a 100644 --- a/mappings.js +++ b/mappings.js @@ -14,11 +14,16 @@ module.exports = { // TODO wtf? isItem: (str) => str.indexOf("Item") != -1, isAbility: (str) => { - if ( str.indexOf("Item") == -1 && + if (str.indexOf("Item") == -1 && (str.indexOf("Ability") != -1 || str.indexOf("ABILITY") != -1) ) { - if (!mappings.has(str)) console.error(str); return true } return false; }, + crashIfBullshit: (str) => { + if(!mappings.has(str)) { + throw "unknown API string `" + str + "`"; + } + return true; + }, isHero: (str) => str.indexOf("*") != -1 && str.indexOf("Item") == -1 }; |
