Allow number or name for translator type in buildDummyTranslator()
This reverts c6b78da69d
, which changed it to expect numbers when I
noticed the type being undefined in debug output, but apparently the
only tests where the type actually mattered passed it as a name.
At some point we should just change all tests to pass as a name.
This commit is contained in:
parent
edb08e179c
commit
a43f9d16ac
1 changed files with 2 additions and 2 deletions
|
@ -776,10 +776,10 @@ var generateTranslatorExportData = Zotero.Promise.coroutine(function* generateTr
|
|||
* Build a dummy translator that can be passed to Zotero.Translate
|
||||
*/
|
||||
function buildDummyTranslator(translatorType, code, info={}) {
|
||||
const TRANSLATOR_TYPES = {1: "import", 2: "export", 4: "web", 8: "search"};
|
||||
const TRANSLATOR_TYPES = {"import":1, "export":2, "web":4, "search":8};
|
||||
info = Object.assign({
|
||||
"translatorID":"dummy-translator",
|
||||
"translatorType":TRANSLATOR_TYPES[translatorType],
|
||||
"translatorType": Number.isInteger(translatorType) ? translatorType : TRANSLATOR_TYPES[translatorType],
|
||||
"label":"Dummy Translator",
|
||||
"creator":"Simon Kornblith",
|
||||
"target":"",
|
||||
|
|
Loading…
Reference in a new issue