rotaready / moment-range

Fancy date ranges for Moment.js
The Unlicense
1.69k stars 202 forks source link

The type declarations don't seem to be up to date with the actual implementation. #249

Closed eweitnauer closed 5 years ago

eweitnauer commented 6 years ago

For example, the method add is implemented as

 add(other, options = { adjacent: false }) {
   ...
}

but the type declaration is add(other: DateRange): ?DateRange; for flow and add(other: DateRange): DateRange | undefined; for typescript – both missing the options parameter.

Maybe just use the declarations from @types/moment-range?

webleaf commented 6 years ago

Also typings don't allow calling moment.range() w/o arguments

TristanJM commented 5 years ago

This is fixed in4.0.2 and will be published on Monday :)