We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 63e79fc commit b3f6a09Copy full SHA for b3f6a09
1 file changed
apps/sim/tools/emailbison/utils.ts
@@ -405,9 +405,12 @@ function mapReplyAttachment(value: unknown): EmailBisonReplyAttachment {
405
}
406
407
408
+function isRecord(value: unknown): value is Record<string, unknown> {
409
+ return Boolean(value) && typeof value === 'object' && !Array.isArray(value)
410
+}
411
+
412
function toRecord(value: unknown): Record<string, unknown> {
- if (!value || typeof value !== 'object' || Array.isArray(value)) return {}
- return value as Record<string, unknown>
413
+ return isRecord(value) ? value : {}
414
415
416
function toArray(value: unknown): unknown[] {
0 commit comments