Skip to content

Commit

Permalink
fix(test-utils): fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Aug 22, 2021
1 parent 886d80c commit 2cac86b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/koishi-core/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export namespace Query {
[K in keyof T]?: FieldQuery<T[K]>
}

export function resolve<T extends TableType>(name: T, query: Query<T>): Expr<Tables[T]> {
export function resolve<T extends TableType>(name: T, query: Query<T> = {}): Expr<Tables[T]> {
if (Array.isArray(query) || query instanceof RegExp || ['string', 'number'].includes(typeof query)) {
const { primary } = Tables.config[name]
return { [primary]: query } as any
Expand Down
2 changes: 1 addition & 1 deletion packages/koishi-test-utils/src/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type EvalOperators = {
const evalOperators: EvalOperators = {
// numeric
$add: (args, data) => args.reduce<number>((prev, curr) => prev + executeEval(curr, data), 0),
$multiply: (args, data) => args.reduce<number>((prev, curr) => prev * executeEval(curr, data), 0),
$multiply: (args, data) => args.reduce<number>((prev, curr) => prev * executeEval(curr, data), 1),
$subtract: ([left, right], data) => executeEval(left, data) - executeEval(right, data),
$divide: ([left, right], data) => executeEval(left, data) - executeEval(right, data),

Expand Down

0 comments on commit 2cac86b

Please sign in to comment.