-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only require ExpressionAttributeNames and Values if the Conditio…
…nExpression uses them
- Loading branch information
sam
committed
Feb 8, 2022
1 parent
b52aefc
commit 7be12fa
Showing
5 changed files
with
98 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
export type Expr = | ||
| ArrayIndex | ||
| Identifier | ||
| NumberLiteral | ||
| OperatorExpr | ||
| NameRef | ||
| PropRef | ||
| ValueRef; | ||
// | ||
|
||
export interface NameRef<Name extends string = string> { | ||
kind: "name-ref"; | ||
name: Name; | ||
} | ||
export interface ValueRef<Name extends string = string> { | ||
kind: "value-ref"; | ||
name: Name; | ||
} | ||
export interface Identifier<I extends string = string> { | ||
kind: "identifier"; | ||
name: I; | ||
} | ||
|
||
export interface NumberLiteral<N extends string = string> { | ||
kind: "index"; | ||
number: N; | ||
} | ||
export interface PropRef<Ex extends Expr = any, Id extends Identifier = any> { | ||
kind: "prop-ref"; | ||
expr: Ex; | ||
name: Id; | ||
} | ||
export interface ArrayIndex< | ||
List extends Expr = any, | ||
Number extends NumberLiteral | ValueRef = NumberLiteral | ValueRef | ||
> { | ||
kind: "array-index"; | ||
list: List; | ||
number: Number; | ||
} | ||
|
||
export type Operator = "and" | "or" | "=" | "<" | "<=" | ">=" | ">"; | ||
export interface OperatorExpr< | ||
Left extends Expr = any, | ||
Op extends Operator = Operator, | ||
Right extends Expr = any | ||
> { | ||
kind: "op"; | ||
left: Left; | ||
op: Op; | ||
right: Right; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters