Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ensure types allow optional function arguments to be omitted #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhibek
Copy link

@zhibek zhibek commented Nov 6, 2024

Related Issue

The current type definitions do not distinguish between optional and required function arguments.

Therefore, the standard NordigenClient instantiation in Typescript results in a type error:

const client = new NordigenClient({
  secretId: process.env.SECRET_ID,
  secretKey: process.env.SECRET_KEY,
});
$ npm exec tsc
src/example.ts:1:35 - error TS2345: Argument of type '{ secretId: string; secretKey: string; }' is not assignable to parameter of type '{ secretId: string; secretKey: string; baseUrl: string; }'.
  Property 'baseUrl' is missing in type '{ secretId: string; secretKey: string; }' but required in type '{ secretId: string; secretKey: string; baseUrl: string; }'.

Proposed Changes

  • Update type definitions for NordigenClient constructor() and initSession() to recognise optional arguments.

Additional Info

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant