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

Request an option: function object-style parameters. #1195

Open
lakca opened this issue Sep 5, 2024 · 0 comments
Open

Request an option: function object-style parameters. #1195

lakca opened this issue Sep 5, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request v3 Kubb v3
Milestone

Comments

@lakca
Copy link

lakca commented Sep 5, 2024

What is the problem this feature would solve?

Expect an alternative:

type Options = {
	name: string,
	params: {/*...*/},
	headers: {/*...*/},
	/* ... */ 
}

function xxx(options: Options) {}

Currently only:

type Options = {
	name: Name,
	params: SomeParams,
	headers: SomeHeaders,
	/* ... */
}

function xxx(name: Name, params: SomeParams, headers: SomeHeaders) {}

External documents/projects?

No response

What is the feature you are proposing to solve the problem?

Avoid redundant undefined to occupy positions when you don't need to provide intermediate parameters, just likes func('a value', undefined, undefined, 'a value')

What alternatives have you considered?

No response

@lakca lakca added the enhancement New feature or request label Sep 5, 2024
@stijnvanhulle stijnvanhulle added the v3 Kubb v3 label Sep 8, 2024
@stijnvanhulle stijnvanhulle self-assigned this Sep 16, 2024
@stijnvanhulle stijnvanhulle added this to the 3.0.0 milestone Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v3 Kubb v3
Projects
None yet
Development

No branches or pull requests

2 participants