extractus / feed-extractor

Simplest way to read & normalize RSS/ATOM/JSON feed data

Home Page:https://extractor-demos.pages.dev/feed-extractor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IDE Type Error when adding optional FeedEntries like category

smc181002 opened this issue · comments

In the index.d.ts file

export interface FeedEntry {
/**
* id, guid, or generated identifier for the entry
*/
id: string;
link?: string;
title?: string;
description?: string;
published?: Date;
}

Since the feed entry allows for custom extra keys like categories and enclosure, Adding an optional parameter would stop the error that pops up in VSCode.

image

In my case, since I am using a string for tags (fetching medium RSS), adding the line like:

interface FeedEntry{
   ...
   category?: Array<string>;
}

But I believe this would fail again if we have a custom object for categories like text and domain as mentioned in the examples on npm.

@smc181002 I'm not sure about how VSCode and TypeScript work in this case. Let's me investigate more. Or, could you try to fix and make a PR?