Skip to content

Static type checking error #108

@sjunel

Description

@sjunel

@pastorsj Hi Sam!

I'm trying to pull series data from FRED and I'm running into a static type checking error. I'm not able to transpile when I'm using the wrapper syntax.

This is the callback I'm using:

async (req: Request, res: Response): Promise<void> => {
  try {
    const series = await fred.series.getSeries('SP500');

    res.send(series);

  } catch (err) {
    res.send(err);
  }

And this is the error I'm getting:

src/app.ts:14:46 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

14   const series = await fred.series.getSeries('SP500');

I checked the wrapper documentation, and the series_id query parameter for getting an economic data series says that it's of type string, so there seems to be a disconnect here.

Thanks for looking into this! Let me know if I can help clarify anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions