Skip to content

Commit

Permalink
fix(core): fix inference for flat types, fix #56, fix #72
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Feb 2, 2024
1 parent dcbdf81 commit 6621d2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/query.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Extract, isNullable } from 'cosmokit'
import { Eval, executeEval } from './eval'
import { Comparable, Indexable, isComparable, makeRegExp } from './utils'
import { Comparable, Flatten, Indexable, isComparable, makeRegExp } from './utils'
import { Selection } from './selection'

export type Query<T = any> = Query.Expr<T> | Query.Shorthand<Indexable> | Selection.Callback<T, boolean>
export type Query<T = any> = Query.Expr<Flatten<T>> | Query.Shorthand<Indexable> | Selection.Callback<T, boolean>

export namespace Query {
export interface FieldExpr<T = any> {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Eval } from './eval'
export type Values<S> = S[keyof S]

export type Keys<O, T = any> = Values<{
[K in keyof O]: O[K] extends T ? K : never
[K in keyof O]: O[K] extends T | undefined ? K : never
}> & string

export type Atomic = number | string | boolean | bigint | symbol | Date
Expand Down

0 comments on commit 6621d2c

Please sign in to comment.