Skip to content

Commit 34b43ad

Browse files
committed
Sync missing sample for typescript
1 parent 7f0febb commit 34b43ad

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • samples/client/petstore/typescript-fetch/builds/date-library-date/src/models

‎samples/client/petstore/typescript-fetch/builds/date-library-date/src/models/Holidays.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ export function HolidaysFromJSONTyped(json: any, ignoreDiscriminator: boolean):
2929
return json;
3030
}
3131
if (Array.isArray(json)) {
32-
if (json.every(item => !(isNaN(parseDate(item).getTime())))) {
33-
return json.map(value => parseDate(value));
32+
if (json.every(item => typeof item === 'number')) {
33+
return json;
3434
}
3535
}
3636
if (Array.isArray(json)) {
37-
if (json.every(item => typeof item === 'number')) {
38-
return json;
37+
if (json.every(item => !(isNaN(parseDate(item).getTime())))) {
38+
return json.map(value => parseDate(value));
3939
}
4040
}
4141
return {} as any;
@@ -50,13 +50,13 @@ export function HolidaysToJSONTyped(value?: Holidays | null, ignoreDiscriminator
5050
return value;
5151
}
5252
if (Array.isArray(value)) {
53-
if (value.every(item => item instanceof Date)) {
54-
return value.map(value => serializeDate(value));
53+
if (value.every(item => typeof item === 'number')) {
54+
return value;
5555
}
5656
}
5757
if (Array.isArray(value)) {
58-
if (value.every(item => typeof item === 'number')) {
59-
return value;
58+
if (value.every(item => item instanceof Date)) {
59+
return value.map(value => serializeDate(value));
6060
}
6161
}
6262
return {};

0 commit comments

Comments
 (0)