Skip to content

Commit

Permalink
Fixed infinite recursion when serializing fields (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
colodenn authored Jan 9, 2025
1 parent 5e30379 commit 02b61cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/serializers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
* @returns The serialized fields.
*/
export const serializeFields = (fields?: Record<string, PrimitivesItem>) => {
if (!fields) return fields;
if (!fields || Array.isArray(fields)) return fields;

return Object.entries(fields).flatMap(
([key, initialValue]): Array<ModelField> | ModelField => {
Expand Down

0 comments on commit 02b61cc

Please sign in to comment.