UNPKG

publication-ids

Version:

Javascript / Typescript validator and parse for publication ids; DOI, PMID, PMCID, ISBN, and ISSN

23 lines (22 loc) 977 B
export interface PMIDParse { source: string | string[]; isValid: boolean; pmid?: string; pmcid?: string; resolve?: string; } /** * Parses a source string to extract and validate PubMed IDs (PMID) and PubMed Central IDs (PMCID). * * @param {string | string[]} source - The source string or array of strings containing potentialPMIDs or PMCIDs. * @returns {PMIDParse[]} An array of objects representing the parsed IDs, including their validity and resolution URLs. * * @typedef {Object} PMIDParse * @property {string | string[]} source - The original source string. * @property {string | undefined} pmid - The parsed PubMed ID, if valid. * @property {string | undefined} pmcid - The parsed PubMed Central ID, if valid. * @property {boolean} isValid - Indicates whether the parsed ID is valid. * @property {string} resolve - The URL to resolve the ID. */ declare const _default: (source: string | string[]) => PMIDParse[]; export default _default;