Skip to content

default property in FunctionParams is ignored for falsy values #1532

Description

@therealsujitk

On a separate note I noticed a bug, if you specify default as '' (an empty string), it simply ignores it. I'm guessing this is because to check if a default value is set we use if (param.default) { ... } or something similar, but an empty string returns false as well and so it gets ignored.

Edit: Here's the issue --> https://github.com/salsita/node-pg-migrate/blob/main/src/utils/formatParams.ts#L30

@Shinigami92 this comment hasn't been taken care of yet.

Originally posted by @therealsujitk in #1198

Metadata

Metadata

Assignees

Labels

c: bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions