Merge pull request #73 from aurimasv/tester
Ignore order when comparing arrays in translatorTester
This commit is contained in:
commit
a9bc55738a
|
@ -220,7 +220,9 @@ Zotero_TranslatorTester._sanitizeItem = function(item, forSave) {
|
|||
const skipFields = ["note", "notes", "itemID", "attachments", "tags", "seeAlso",
|
||||
"itemType", "complete", "creators"];
|
||||
for(var field in item) {
|
||||
if(skipFields.indexOf(field) !== -1) continue;
|
||||
if(skipFields.indexOf(field) !== -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!item[field] || !(fieldID = Zotero.ItemFields.getID(field))) {
|
||||
delete item[field];
|
||||
|
@ -241,6 +243,9 @@ Zotero_TranslatorTester._sanitizeItem = function(item, forSave) {
|
|||
|
||||
// remove fields to be ignored
|
||||
if("accessDate" in item) delete item.accessDate;
|
||||
|
||||
//sort tags, if they're still there
|
||||
if(item.tags) item.tags.sort();
|
||||
|
||||
return item;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user