kubb icon indicating copy to clipboard operation
kubb copied to clipboard

Request an option: function object-style parameters.

Open lakca opened this issue 5 months ago • 0 comments

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 avatar Sep 05 '24 08:09 lakca