Skip to content

Commit

Permalink
refactor: remove unused function
Browse files Browse the repository at this point in the history
It's unused and appears to do nothing anyhow.

Refs #397, #398
  • Loading branch information
thewilkybarkid committed Sep 7, 2021
1 parent 81c51c8 commit a637a6d
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions src/backend/utils/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import identifiersArxiv from 'identifiers-arxiv';
import scrape from 'html-metadata';
import { search as scholarSearch } from 'scholarly';
import CrossRef from 'crossref';
import { getOrcidPerson } from './orcid.js';
import ChainedError from 'typescript-chained-error';
import { getLogger } from '../log.js';

Expand Down Expand Up @@ -258,46 +257,3 @@ export async function resolvePreprint(

return metadata;
}

export async function resolveUser(handle: string): Promise<any> {
const person = await getOrcidPerson(handle);

// Process the deep JSON structure for a given ORCID user
if (person) {
const persona = {};
if (person.name) {
if (person.name['credit-name'] && person.name['credit-name'].value) {
persona.name = person.name['credit-name'].value;
} else {
persona.name =
person.name['given-names'] && person.name['given-names'].value
? person.name['given-names'].value
: '';
if (person.name['family-name'] && person.name['family-name'].value) {
persona.name = persona.name.concat(
' ',
person.name['family-name'].value,
);
}
}
}

if (person.biography && person.biography['content']) {
persona.bio = person.biography['content'];
}

let contacts = [];
if (Array.isArray(person.emails.email) && person.emails.email.length > 0) {
for (const e of person.emails.email) {
contacts.push({
schema: 'mailto',
value: e.email,
verified: !!e.verified,
});
}
}
if (contacts.length > 0) {
contacts = [...new Set(contacts)];
}
}
}

0 comments on commit a637a6d

Please sign in to comment.