Skip to content

Commit

Permalink
arXiv: Use Atom API instead of OAI (#3366)
Browse files Browse the repository at this point in the history
Co-authored-by: zoe-translates <[email protected]>
Co-authored-by: Abe Jellinek <[email protected]>
  • Loading branch information
3 people authored Oct 9, 2024
1 parent e6f65ba commit 30664ce
Show file tree
Hide file tree
Showing 2 changed files with 446 additions and 208 deletions.
12 changes: 9 additions & 3 deletions .ci/eslint-plugin-zotero-translator/lib/rules/test-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,15 @@ module.exports = {
});
}
else if (testCase.type === 'search') {
const expected = ['DOI', 'ISBN', 'PMID', 'identifiers', 'contextObject', 'adsBibcode', 'ericNumber', 'openAlex'];
const keys = Array.isArray(testCase.input) ? testCase.input.flatMap(Object.keys) : Object.keys(testCase.input);

// console.log(JSON.stringify(testCase.input))
const expected = ['DOI', 'ISBN', 'PMID', 'arXiv', 'identifiers', 'contextObject', 'adsBibcode', 'ericNumber', 'openAlex'];
let keys;
if (Array.isArray(testCase.input)) {
keys = testCase.input.flatMap(Object.keys);
}
else {
keys = Object.keys(testCase.input);
}
if (!keys.every(key => expected.includes(key))) {
const invalidKey = keys.find(key => !expected.includes(key));
context.report({
Expand Down
Loading

0 comments on commit 30664ce

Please sign in to comment.