Skip to content

Commit

Permalink
Add 'not' function to Expr module
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-dldc committed Jan 29, 2024
1 parent 9508c7f commit 6b74c05
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Expr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const Expr = (() => {
like,
or,
and,
not,
notNull,
lowerThan,
lowerThanOrEqual,
Expand Down Expand Up @@ -221,6 +222,14 @@ export const Expr = (() => {
});
}

function not<E extends IExprUnknow>(expr: E): IExpr<boolean, E[TYPES]['nullable']> {
return create(builder.Expr.not(expr.ast), {
parse: Datatype.boolean.parse,
nullable: expr[PRIV].nullable,
dependencies: expr[PRIV].dependencies,
});
}

function notNull(expr: IExprUnknow): IExpr<boolean, false> {
return create(builder.Expr.notNull(expr.ast), { parse: Datatype.boolean.parse, nullable: false });
}
Expand Down

0 comments on commit 6b74c05

Please sign in to comment.