UNPKG

publication-ids

Version:

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

25 lines (24 loc) 923 B
import { type ISBNParse } from '../isbn/parse'; export interface DoiParse { source: string | string[]; isValid: boolean; doi?: string; resolve?: string; isbn?: Partial<ISBNParse> & { chapter?: string; }; } /** * Parses a source string to extract and validate DOIs. * * @param {string | string[]} source - The source string or array of strings containing potential DOIs * @returns {DoiParse[]} An array of objects representing the parsed IDs, including their validity and resolution URLs. * * @typedef {Object} DOIParse * @property {string | string[]} source - The original source string. * @property {string | undefined} doi - The parsed DOI, 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[]) => DoiParse[]; export default _default;