Skip to content

Incomplete type declaration in interface FeedData for property description #137

@WetHat

Description

@WetHat

In the interface FeedData the property decription is declared as:

description?: string;

However sometimes the description element in the parsed RSS feed is returned as object:

"description": {
    "#text": "Updates, ideas, and inspiration from GitHub to help developers build and design software.",
    "@_type": "text"
  },

To accurately reflect this situation the FeedData interface could be changed like so:

/**
 * Type for property bag objects (key -> value) with unknown content.
 */
export type TPropertyBag = { [key: string]: any };

export interface FeedData {
  link?: string;
  title?: string;
  description?: string | TPropertyBag ;
  generator?: string;
  language?: string;
  published?: string;
  entries?: Array<FeedEntry>;
}

Alternatively, the extractor could desctructure the description element and just return the string.

feed.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions