Implement Adri's type guard suggestion.

This commit is contained in:
Sam Rose 2024-03-13 13:38:08 +00:00
parent d061c19c80
commit a5c8e8845f
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -4,9 +4,11 @@ import { QueryOptions } from "../../definitions/datasource"
import { isIsoDateString, SqlClient, isValidFilter } from "../utils"
import SqlTableQueryBuilder from "./sqlTable"
import {
BBReferenceFieldMetadata,
FieldSchema,
FieldSubtype,
FieldType,
JsonFieldMetadata,
Operation,
QueryJson,
RelationshipsJson,
@ -716,7 +718,9 @@ class SqlQueryBuilder extends SqlTableQueryBuilder {
return results
}
_isJsonColumn(field: FieldSchema) {
_isJsonColumn(
field: FieldSchema
): field is JsonFieldMetadata | BBReferenceFieldMetadata {
return (
field.type === FieldType.JSON ||
(field.type === FieldType.BB_REFERENCE &&