package-build-stats icon indicating copy to clipboard operation
package-build-stats copied to clipboard

`getPackageStats` options object required?

Open rafgraph opened this issue 3 years ago • 1 comments

It seems the typing now requires an options object be passed to getPackageStats. The code seems to run fine without it (and the docs indicate it's optional), so this might just be a typing error.

src/bundlephobiaStats.ts:50:32 - error TS2554: Expected 2 arguments, but got 1.

50     const packageStats = await getPackageStats(cwd);
                                  ~~~~~~~~~~~~~~~~~~~~

  node_modules/package-build-stats/build/getPackageStats.d.ts:8:3
    8   optionsRaw: GetPackageStatsOptions
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    An argument for 'optionsRaw' was not provided.

rafgraph avatar Apr 06 '21 02:04 rafgraph

I think optionsRaw can be set to optional here: https://github.com/pastelsky/package-build-stats/blob/master/src/getPackageStats.ts#L53

rafgraph avatar Apr 06 '21 03:04 rafgraph