Skip to content

Commit

Permalink
chore: Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
schpet committed Nov 27, 2024
1 parent 16a3b10 commit 0081428
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ function serializeValue(value: unknown, schemaType: z.ZodTypeAny): string | unde
if (schemaType instanceof z.ZodDefault) {
// Serialize the value according to the defaults value
// If the serialized default is the same then we skip it
let serialized = serializeValue(value, schemaType._def.innerType);
let defaultValue = serializeValue(schemaType._def.defaultValue(), schemaType._def.innerType);
if (serialized === defaultValue) return undefined;
return serialized;
let serialized = serializeValue(value, schemaType._def.innerType)
let defaultValue = serializeValue(schemaType._def.defaultValue(), schemaType._def.innerType)
if (serialized === defaultValue) return undefined
return serialized
}
return otherToString.parse(value)
}
Expand Down Expand Up @@ -244,11 +244,11 @@ function serialize<T extends Schema>({
if (defaultData == null || !isEqual(value, defaultData[key])) {
if (schemaType instanceof z.ZodArray) {
for (let item of value as unknown[]) {
let serialized = serializeValue(item, schemaType.element);
let serialized = serializeValue(item, schemaType.element)
if (serialized !== undefined) params.append(key, serialized)
}
} else {
let serialized = serializeValue(value, schemaType);
let serialized = serializeValue(value, schemaType)
if (serialized !== undefined) params.append(key, serialized)
}
}
Expand Down

0 comments on commit 0081428

Please sign in to comment.