Skip to content

Commit

Permalink
feat(types): publicize the Falsy type
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Aug 23, 2024
1 parent ecd37b0 commit 736d334
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/array/sift.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type Falsy = null | undefined | false | '' | 0 | 0n
import type { Falsy } from 'radashi'

/**
* Given a list returns a new list with only truthy values.
Expand Down
8 changes: 8 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import type { BigInt, BigInt64Array, BigUint64Array } from './bigint'

/**
* Represents values that are considered "falsy" in JavaScript. These
* values cause the condition in an `if` statement or ternary
* expression to be false, leading to the execution of the `else`
* branch.
*/
export type Falsy = null | undefined | false | '' | 0 | 0n

declare const any: unique symbol

/**
Expand Down

0 comments on commit 736d334

Please sign in to comment.