Skip to content

Fix type for flush promise return value: Boolean -> boolean#47

Merged
nblumhardt merged 1 commit intodatalust:devfrom
rj-au:patch-2
Sep 12, 2025
Merged

Fix type for flush promise return value: Boolean -> boolean#47
nblumhardt merged 1 commit intodatalust:devfrom
rj-au:patch-2

Conversation

@rj-au
Copy link
Copy Markdown
Contributor

@rj-au rj-au commented Sep 11, 2025

In TypeScript, there is a crucial distinction between boolean (lowercase) and Boolean (uppercase).

boolean (lowercase): This refers to the primitive boolean type in TypeScript and JavaScript. It represents a simple true or false value. This is the type that should be used almost exclusively when declaring variables, function parameters, or return types in TypeScript.

Boolean (uppercase): This refers to the JavaScript Boolean object wrapper. While it can also hold a true or false value, it is an object, not a primitive. Using Boolean objects can lead to unexpected behavior due to JavaScript's type coercion rules, where an object (even a Boolean object wrapping false) is considered "truthy" in a boolean context.

In TypeScript, there is a crucial distinction between boolean (lowercase) and Boolean (uppercase).

boolean (lowercase): This refers to the primitive boolean type in TypeScript and JavaScript. It represents a simple true or false value. This is the type that should be used almost exclusively when declaring variables, function parameters, or return types in TypeScript.

Boolean (uppercase): This refers to the JavaScript Boolean object wrapper. While it can also hold a true or false value, it is an object, not a primitive. Using Boolean objects can lead to unexpected behavior due to JavaScript's type coercion rules, where an object (even a Boolean object wrapping false) is considered "truthy" in a boolean context.
@nblumhardt
Copy link
Copy Markdown
Member

Nice spotting - thanks 👍

@nblumhardt nblumhardt merged commit cada59c into datalust:dev Sep 12, 2025
9 checks passed
@KodrAus KodrAus mentioned this pull request Oct 19, 2025
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 this pull request may close these issues.

2 participants