Skip to content

Commit

Permalink
v2.8.0 support TS 5.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tylim88 committed Mar 9, 2024
1 parent ec82c9d commit 22651e4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firelord",
"version": "2.7.2",
"version": "2.8.0",
"description": "🔥 Write V9 like Firestore Admin code with extreme type safety.",
"author": "tylim",
"license": "MIT",
Expand Down Expand Up @@ -91,7 +91,7 @@
"prettier": "^2.8.6",
"pretty-quick": "^3.1.3",
"rollup": "^2.79.1",
"typescript": "^5.2.2",
"typescript": "^5.4.2",
"vitest": "^0.29.7"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/queryConstraints/offset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Offset } from '../types'
* @param offset The offset to apply to the Query results.
* @returns A {@link QueryConstraint} to pass to `query()`
*/
// @ts-expect-error
export const offset: Offset = offset => {
return {
type: 'offset',
Expand Down
6 changes: 5 additions & 1 deletion src/refs/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,30 @@ import { handleEmptyArray } from './utils'
export const query: QueryFunction = (query, ...queryConstraints) => {
const ref = query as OriQuery<MetaType>
// ! need revisit
// @ts-expect-error
return queryConstraints.reduce((ref, qc) => {
const type = qc.type
if (type === 'where') {
// @ts-expect-error
return ref[type](qc.fieldPath, qc.opStr, qc.value)
} else if (type === 'orderBy') {
// @ts-expect-error
return ref[type](qc.fieldPath, qc.directionStr)
} else if (
type === 'limit' ||
type === 'limitToLast' ||
type === 'offset'
) {
// @ts-expect-error
return ref[type](qc.value)
} else if (
type === 'startAt' ||
type === 'startAfter' ||
type === 'endAt' ||
type === 'endBefore'
) {
// @ts-expect-error
return handleEmptyArray(qc.values, ref, () => ref[type](...qc.values))
}
// @ts-expect-error
}, ref)
}

0 comments on commit 22651e4

Please sign in to comment.