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

[TS] alter() requires 1 argument #4995

Closed
rafaelalmeidatk opened this issue Feb 2, 2022 · 1 comment · Fixed by #4996
Closed

[TS] alter() requires 1 argument #4995

rafaelalmeidatk opened this issue Feb 2, 2022 · 1 comment · Fixed by #4996

Comments

@rafaelalmeidatk
Copy link
Contributor

Environment

Knex version: 1.0.2

If issue is about TypeScript definitions, tag @lorefnon.

Bug

Since #4967, alter() requires 1 argument. I believe the type of the function should mark the options object as optional, since the function signature sets it as an empty object if no argument is provided:

AlterMethods.alter = function ({
alterNullable = true,
alterType = true,
} = {}) {

Reproduction of the bug (using the code examples from the docs):

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgaQHYFMAecC+cBmUEIcA5ANYaakBQNAJugMYA2AhlOnExKgM7xKWAFwoqAbjpDMAOj5MAFuhBsZbFjHRQAKmwBGLdAApSAVz5bSAGgKnUTGMF5GYASkQ04cGDOD3OIOioMHxGrjJgUKAcAJ5h4nAA9IlwbPT0nkkp9ERgfHCR6ABuTuZwjPhsphpwReqmXITE3BAspiCoNopsqADmXDAxYAMQcAJRfamo9KnpcKgQ8KjV7AZcPPwwUGx+MJk+4369JuZaqGyB1nAAzACs4QswAHIr+oZhahpa8ZnJ5bn5PSLBTzRbzFYtTbbXZTGYwJTldCVarwOptdD7XzBdD9KAmNj9UjhdSaPGuSReP7AfCpL5QF4sVaGODAfKVFgWGw5CB5OC8FgxbwIipVGpohqY3Y476kAnoImfUlGBAkrQMplcUTsiw4cm-FLU2mk7RDLisgjqTneU18mk8NodFn5R5GrToegySXY3H4wnEunK1U6G1ay3oXWSCNAA

@kibertoad
Copy link
Collaborator

Released in 1.0.3

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 a pull request may close this issue.

2 participants