Skip to content

Commit 78d1406

Browse files
committed
simplify field value type
1 parent b8d0b74 commit 78d1406

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firelord",
3-
"version": "2.8.16",
3+
"version": "2.8.17",
44
"description": "🔥 Write V9 like Firestore Admin code with extreme type safety.",
55
"author": "tylim",
66
"license": "MIT",

src/fieldValues/deleteField.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ import { Delete } from '../types'
77
*
88
* @return The FieldValue sentinel for use in a call to set() or update().
99
*/
10-
// @ts-expect-error
11-
export const deleteField = (): Delete => FieldValue.delete()
10+
export const deleteField = () => FieldValue.delete() as Delete

src/fieldValues/documentId.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import { __name__ } from '../types'
2-
31
/**
42
* Returns a special sentinel `FieldPath` to refer to the ID of a document.
53
* It can be used in queries to sort or filter by the document ID.
64
* documentId() no longer play any significant role because you can replace it with string `__name__`.
75
* It is kept for backward compatibility.
86
*/
9-
export const documentId = (): __name__ => '__name__'
7+
export const documentId = () => '__name__' as const

src/fieldValues/increment.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ import { Increment } from '../types'
1818
* @return The FieldValue sentinel for use in a call to set(), create() or
1919
* update().
2020
*/
21-
// @ts-expect-error
22-
export const increment = (n: number): Increment => FieldValue.increment(n)
21+
export const increment = (n: number) => FieldValue.increment(n) as Increment

src/fieldValues/serverTimestamp.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ import { ServerTimestamp } from '../types'
99
* update().
1010
*/
1111

12-
export const serverTimestamp = (): ServerTimestamp =>
13-
// @ts-expect-error
14-
FieldValue.serverTimestamp()
12+
export const serverTimestamp = () =>
13+
FieldValue.serverTimestamp() as ServerTimestamp

0 commit comments

Comments
 (0)