feed icon indicating copy to clipboard operation
feed copied to clipboard

FeedOptions require both "feed" and "feedLinks"

Open virtulis opened this issue 7 years ago • 0 comments

Describe the bug The FeedOptions interface lists feed and feedLinks as required (without ?) which means that both of these keys must be set or TypeScript complains.

To Reproduce Copy the actual example from the readme.

Expected behavior Example compiles and works cleanly.

Actual behavior TypeScript outputs an error:

routes/blog.ts:119:24 - error TS2345: Argument of type '{ title: string; description: string; id: string; link: string; image: string; favicon: string; copyright: string; updated: Date; generator: string; feedLinks: { json: string; atom: string; }; author: { ...; }; }' is not assignable to parameter of type 'FeedOptions'.
  Property 'feed' is missing in type '{ title: string; description: string; id: string; link: string; image: string; favicon: string; copyright: string; updated: Date; generator: string; feedLinks: { json: string; atom: string; }; author: { ...; }; }'.

It still compiles and works :man_shrugging:

Versions (please complete the following information):

  • NodeJS: 10.7.0
  • TypeScript: 3.0.1
  • npm/yarn: 6.3.0
  • feed: 2.0.1

Additional context I see no reason why either of these keys should be required as everything works fine without them.

virtulis avatar Aug 22 '18 15:08 virtulis