• Extracts accession IDs from an SSSResultModel object as a comma-separated string.

    Parameters

    • sssDataObj: SSSResultModel

      The SSSResultModel object containing hit data.

    • OptionalnumberHits: number = 30

      The maximum number of hits to process (defaults to 30, clamped to 0 if negative).

    Returns string

    • A comma-separated string of accession IDs from the hits, or an empty string if no valid hits are present.

    getIPRMCDbfetchAccessions

    Extracts accession IDs (hit_acc) from the hits array in the SSSResultModel object, up to the specified numberHits, and joins them with commas. Returns an empty string if hits is undefined, empty, or numberHits is 0 or negative.

    const sssData = {
    hits: [
    { hit_acc: 'P12345' },
    { hit_acc: 'P67890' }
    ]
    };
    console.log(getIPRMCDbfetchAccessions(sssData));
    // Outputs: "P12345,P67890"

    console.log(getIPRMCDbfetchAccessions({ hits: [] }, 2));
    // Outputs: ""