oauth2-client-js icon indicating copy to clipboard operation
oauth2-client-js copied to clipboard

Type declaration to not require optional parameters

Open jtfell opened this issue 7 years ago • 1 comments

The current type declaration requires that all properties are supplied when creating a new Provider or Request object, when the code supplies default values in the constructor.

See:

  • https://github.com/zalando-stups/oauth2-client-js/blob/master/src/request.js#L17
  • https://github.com/zalando-stups/oauth2-client-js/blob/master/src/request.js#L30
  • https://github.com/zalando-stups/oauth2-client-js/blob/master/src/provider.js#L13

This PR flags the non-required parameters as optional so that using the default values passes type-checking. Without this change, the main example in the README has TS errors.

jtfell avatar Jan 08 '18 00:01 jtfell

Bump this. It makes the lib very awkward to use in a strict TS environment.

Sunjammer avatar Feb 26 '18 17:02 Sunjammer