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

refactor!: Remove src/options.ts #1658

Open
danielbankhead opened this issue Oct 2, 2023 · 3 comments
Open

refactor!: Remove src/options.ts #1658

danielbankhead opened this issue Oct 2, 2023 · 3 comments
Assignees
Labels
Breaking Change good first issue This issue is a good place to started contributing to this repository. next major: breaking change this is a change that we should wait to bundle into the next major version priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@danielbankhead
Copy link
Member

It's pretty legacy at this point and we can clean up this unnecessary code.

export function validate(options: any) {
const vpairs = [
{invalid: 'uri', expected: 'url'},
{invalid: 'json', expected: 'data'},
{invalid: 'qs', expected: 'params'},
];
for (const pair of vpairs) {
if (options[pair.invalid]) {
const e = `'${pair.invalid}' is not a valid configuration option. Please use '${pair.expected}' instead. This library is using Axios for requests. Please see https://github.com/axios/axios to learn more about the valid request options.`;
throw new Error(e);
}
}
}

@danielbankhead danielbankhead added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. good first issue This issue is a good place to started contributing to this repository. Breaking Change priority: p3 Desirable enhancement or fix. May not be included in next release. next major: breaking change this is a change that we should wait to bundle into the next major version labels Oct 2, 2023
@NewtonFernandis
Copy link

Hi @danielbankhead, I would like to work on this. Could you please assign this to me?

@danielbankhead
Copy link
Member Author

danielbankhead commented Oct 3, 2023

@NewtonFernandis Absolutely, take your time as we won't be able to merge this fix until the library's next major release (likely sometime next year).

@NewtonFernandis
Copy link

Cool 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change good first issue This issue is a good place to started contributing to this repository. next major: breaking change this is a change that we should wait to bundle into the next major version priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants