[typescript-fetch] Make instanceOf infer type and check for undefineds (#18694)

This commit is contained in:
Marcus Pasell 2024-05-17 08:22:32 -07:00 committed by GitHub
parent 2fe397cb3e
commit 62238c6886
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
149 changed files with 216 additions and 216 deletions

View File

@ -20,10 +20,10 @@ import { {{modelName}}FromJSONTyped } from './{{modelName}}{{importFileExtension
/** /**
* Check if a given object implements the {{classname}} interface. * Check if a given object implements the {{classname}} interface.
*/ */
export function instanceOf{{classname}}(value: object): boolean { export function instanceOf{{classname}}(value: object): value is {{classname}} {
{{#vars}} {{#vars}}
{{#required}} {{#required}}
if (!('{{name}}' in value)) return false; if (!('{{name}}' in value) || value['{{name}}'] === undefined) return false;
{{/required}} {{/required}}
{{/vars}} {{/vars}}
return true; return true;

View File

@ -37,7 +37,7 @@ export interface Club {
/** /**
* Check if a given object implements the Club interface. * Check if a given object implements the Club interface.
*/ */
export function instanceOfClub(value: object): boolean { export function instanceOfClub(value: object): value is Club {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface Owner {
/** /**
* Check if a given object implements the Owner interface. * Check if a given object implements the Owner interface.
*/ */
export function instanceOfOwner(value: object): boolean { export function instanceOfOwner(value: object): value is Owner {
return true; return true;
} }

View File

@ -37,7 +37,7 @@ export interface Club {
/** /**
* Check if a given object implements the Club interface. * Check if a given object implements the Club interface.
*/ */
export function instanceOfClub(value: object): boolean { export function instanceOfClub(value: object): value is Club {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface Owner {
/** /**
* Check if a given object implements the Owner interface. * Check if a given object implements the Owner interface.
*/ */
export function instanceOfOwner(value: object): boolean { export function instanceOfOwner(value: object): value is Owner {
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface AdditionalPropertiesClass {
/** /**
* Check if a given object implements the AdditionalPropertiesClass interface. * Check if a given object implements the AdditionalPropertiesClass interface.
*/ */
export function instanceOfAdditionalPropertiesClass(value: object): boolean { export function instanceOfAdditionalPropertiesClass(value: object): value is AdditionalPropertiesClass {
return true; return true;
} }

View File

@ -43,7 +43,7 @@ export interface AllOfWithSingleRef {
/** /**
* Check if a given object implements the AllOfWithSingleRef interface. * Check if a given object implements the AllOfWithSingleRef interface.
*/ */
export function instanceOfAllOfWithSingleRef(value: object): boolean { export function instanceOfAllOfWithSingleRef(value: object): value is AllOfWithSingleRef {
return true; return true;
} }

View File

@ -38,8 +38,8 @@ export interface Animal {
/** /**
* Check if a given object implements the Animal interface. * Check if a given object implements the Animal interface.
*/ */
export function instanceOfAnimal(value: object): boolean { export function instanceOfAnimal(value: object): value is Animal {
if (!('className' in value)) return false; if (!('className' in value) || value['className'] === undefined) return false;
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface ArrayOfArrayOfNumberOnly {
/** /**
* Check if a given object implements the ArrayOfArrayOfNumberOnly interface. * Check if a given object implements the ArrayOfArrayOfNumberOnly interface.
*/ */
export function instanceOfArrayOfArrayOfNumberOnly(value: object): boolean { export function instanceOfArrayOfArrayOfNumberOnly(value: object): value is ArrayOfArrayOfNumberOnly {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface ArrayOfNumberOnly {
/** /**
* Check if a given object implements the ArrayOfNumberOnly interface. * Check if a given object implements the ArrayOfNumberOnly interface.
*/ */
export function instanceOfArrayOfNumberOnly(value: object): boolean { export function instanceOfArrayOfNumberOnly(value: object): value is ArrayOfNumberOnly {
return true; return true;
} }

View File

@ -49,7 +49,7 @@ export interface ArrayTest {
/** /**
* Check if a given object implements the ArrayTest interface. * Check if a given object implements the ArrayTest interface.
*/ */
export function instanceOfArrayTest(value: object): boolean { export function instanceOfArrayTest(value: object): value is ArrayTest {
return true; return true;
} }

View File

@ -61,7 +61,7 @@ export interface Capitalization {
/** /**
* Check if a given object implements the Capitalization interface. * Check if a given object implements the Capitalization interface.
*/ */
export function instanceOfCapitalization(value: object): boolean { export function instanceOfCapitalization(value: object): value is Capitalization {
return true; return true;
} }

View File

@ -37,7 +37,7 @@ export interface Cat extends Animal {
/** /**
* Check if a given object implements the Cat interface. * Check if a given object implements the Cat interface.
*/ */
export function instanceOfCat(value: object): boolean { export function instanceOfCat(value: object): value is Cat {
return true; return true;
} }

View File

@ -36,8 +36,8 @@ export interface Category {
/** /**
* Check if a given object implements the Category interface. * Check if a given object implements the Category interface.
*/ */
export function instanceOfCategory(value: object): boolean { export function instanceOfCategory(value: object): value is Category {
if (!('name' in value)) return false; if (!('name' in value) || value['name'] === undefined) return false;
return true; return true;
} }

View File

@ -39,7 +39,7 @@ export interface ChildWithNullable extends ParentWithNullable {
/** /**
* Check if a given object implements the ChildWithNullable interface. * Check if a given object implements the ChildWithNullable interface.
*/ */
export function instanceOfChildWithNullable(value: object): boolean { export function instanceOfChildWithNullable(value: object): value is ChildWithNullable {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface ClassModel {
/** /**
* Check if a given object implements the ClassModel interface. * Check if a given object implements the ClassModel interface.
*/ */
export function instanceOfClassModel(value: object): boolean { export function instanceOfClassModel(value: object): value is ClassModel {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface Client {
/** /**
* Check if a given object implements the Client interface. * Check if a given object implements the Client interface.
*/ */
export function instanceOfClient(value: object): boolean { export function instanceOfClient(value: object): value is Client {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface DeprecatedObject {
/** /**
* Check if a given object implements the DeprecatedObject interface. * Check if a given object implements the DeprecatedObject interface.
*/ */
export function instanceOfDeprecatedObject(value: object): boolean { export function instanceOfDeprecatedObject(value: object): value is DeprecatedObject {
return true; return true;
} }

View File

@ -37,7 +37,7 @@ export interface Dog extends Animal {
/** /**
* Check if a given object implements the Dog interface. * Check if a given object implements the Dog interface.
*/ */
export function instanceOfDog(value: object): boolean { export function instanceOfDog(value: object): value is Dog {
return true; return true;
} }

View File

@ -56,7 +56,7 @@ export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeo
/** /**
* Check if a given object implements the EnumArrays interface. * Check if a given object implements the EnumArrays interface.
*/ */
export function instanceOfEnumArrays(value: object): boolean { export function instanceOfEnumArrays(value: object): value is EnumArrays {
return true; return true;
} }

View File

@ -137,8 +137,8 @@ export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof
/** /**
* Check if a given object implements the EnumTest interface. * Check if a given object implements the EnumTest interface.
*/ */
export function instanceOfEnumTest(value: object): boolean { export function instanceOfEnumTest(value: object): value is EnumTest {
if (!('enumStringRequired' in value)) return false; if (!('enumStringRequired' in value) || value['enumStringRequired'] === undefined) return false;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface FakeBigDecimalMap200Response {
/** /**
* Check if a given object implements the FakeBigDecimalMap200Response interface. * Check if a given object implements the FakeBigDecimalMap200Response interface.
*/ */
export function instanceOfFakeBigDecimalMap200Response(value: object): boolean { export function instanceOfFakeBigDecimalMap200Response(value: object): value is FakeBigDecimalMap200Response {
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface FileSchemaTestClass {
/** /**
* Check if a given object implements the FileSchemaTestClass interface. * Check if a given object implements the FileSchemaTestClass interface.
*/ */
export function instanceOfFileSchemaTestClass(value: object): boolean { export function instanceOfFileSchemaTestClass(value: object): value is FileSchemaTestClass {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface Foo {
/** /**
* Check if a given object implements the Foo interface. * Check if a given object implements the Foo interface.
*/ */
export function instanceOfFoo(value: object): boolean { export function instanceOfFoo(value: object): value is Foo {
return true; return true;
} }

View File

@ -37,7 +37,7 @@ export interface FooGetDefaultResponse {
/** /**
* Check if a given object implements the FooGetDefaultResponse interface. * Check if a given object implements the FooGetDefaultResponse interface.
*/ */
export function instanceOfFooGetDefaultResponse(value: object): boolean { export function instanceOfFooGetDefaultResponse(value: object): value is FooGetDefaultResponse {
return true; return true;
} }

View File

@ -127,11 +127,11 @@ export interface FormatTest {
/** /**
* Check if a given object implements the FormatTest interface. * Check if a given object implements the FormatTest interface.
*/ */
export function instanceOfFormatTest(value: object): boolean { export function instanceOfFormatTest(value: object): value is FormatTest {
if (!('number' in value)) return false; if (!('number' in value) || value['number'] === undefined) return false;
if (!('_byte' in value)) return false; if (!('_byte' in value) || value['_byte'] === undefined) return false;
if (!('date' in value)) return false; if (!('date' in value) || value['date'] === undefined) return false;
if (!('password' in value)) return false; if (!('password' in value) || value['password'] === undefined) return false;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface HasOnlyReadOnly {
/** /**
* Check if a given object implements the HasOnlyReadOnly interface. * Check if a given object implements the HasOnlyReadOnly interface.
*/ */
export function instanceOfHasOnlyReadOnly(value: object): boolean { export function instanceOfHasOnlyReadOnly(value: object): value is HasOnlyReadOnly {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface HealthCheckResult {
/** /**
* Check if a given object implements the HealthCheckResult interface. * Check if a given object implements the HealthCheckResult interface.
*/ */
export function instanceOfHealthCheckResult(value: object): boolean { export function instanceOfHealthCheckResult(value: object): value is HealthCheckResult {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface List {
/** /**
* Check if a given object implements the List interface. * Check if a given object implements the List interface.
*/ */
export function instanceOfList(value: object): boolean { export function instanceOfList(value: object): value is List {
return true; return true;
} }

View File

@ -59,7 +59,7 @@ export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof
/** /**
* Check if a given object implements the MapTest interface. * Check if a given object implements the MapTest interface.
*/ */
export function instanceOfMapTest(value: object): boolean { export function instanceOfMapTest(value: object): value is MapTest {
return true; return true;
} }

View File

@ -49,7 +49,7 @@ export interface MixedPropertiesAndAdditionalPropertiesClass {
/** /**
* Check if a given object implements the MixedPropertiesAndAdditionalPropertiesClass interface. * Check if a given object implements the MixedPropertiesAndAdditionalPropertiesClass interface.
*/ */
export function instanceOfMixedPropertiesAndAdditionalPropertiesClass(value: object): boolean { export function instanceOfMixedPropertiesAndAdditionalPropertiesClass(value: object): value is MixedPropertiesAndAdditionalPropertiesClass {
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Model200Response {
/** /**
* Check if a given object implements the Model200Response interface. * Check if a given object implements the Model200Response interface.
*/ */
export function instanceOfModel200Response(value: object): boolean { export function instanceOfModel200Response(value: object): value is Model200Response {
return true; return true;
} }

View File

@ -42,7 +42,7 @@ export interface ModelApiResponse {
/** /**
* Check if a given object implements the ModelApiResponse interface. * Check if a given object implements the ModelApiResponse interface.
*/ */
export function instanceOfModelApiResponse(value: object): boolean { export function instanceOfModelApiResponse(value: object): value is ModelApiResponse {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface ModelFile {
/** /**
* Check if a given object implements the ModelFile interface. * Check if a given object implements the ModelFile interface.
*/ */
export function instanceOfModelFile(value: object): boolean { export function instanceOfModelFile(value: object): value is ModelFile {
return true; return true;
} }

View File

@ -48,8 +48,8 @@ export interface Name {
/** /**
* Check if a given object implements the Name interface. * Check if a given object implements the Name interface.
*/ */
export function instanceOfName(value: object): boolean { export function instanceOfName(value: object): value is Name {
if (!('name' in value)) return false; if (!('name' in value) || value['name'] === undefined) return false;
return true; return true;
} }

View File

@ -97,7 +97,7 @@ export interface NullableClass {
/** /**
* Check if a given object implements the NullableClass interface. * Check if a given object implements the NullableClass interface.
*/ */
export function instanceOfNullableClass(value: object): boolean { export function instanceOfNullableClass(value: object): value is NullableClass {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface NumberOnly {
/** /**
* Check if a given object implements the NumberOnly interface. * Check if a given object implements the NumberOnly interface.
*/ */
export function instanceOfNumberOnly(value: object): boolean { export function instanceOfNumberOnly(value: object): value is NumberOnly {
return true; return true;
} }

View File

@ -58,7 +58,7 @@ export interface ObjectWithDeprecatedFields {
/** /**
* Check if a given object implements the ObjectWithDeprecatedFields interface. * Check if a given object implements the ObjectWithDeprecatedFields interface.
*/ */
export function instanceOfObjectWithDeprecatedFields(value: object): boolean { export function instanceOfObjectWithDeprecatedFields(value: object): value is ObjectWithDeprecatedFields {
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
/** /**
* Check if a given object implements the Order interface. * Check if a given object implements the Order interface.
*/ */
export function instanceOfOrder(value: object): boolean { export function instanceOfOrder(value: object): value is Order {
return true; return true;
} }

View File

@ -42,7 +42,7 @@ export interface OuterComposite {
/** /**
* Check if a given object implements the OuterComposite interface. * Check if a given object implements the OuterComposite interface.
*/ */
export function instanceOfOuterComposite(value: object): boolean { export function instanceOfOuterComposite(value: object): value is OuterComposite {
return true; return true;
} }

View File

@ -37,8 +37,8 @@ export interface OuterObjectWithEnumProperty {
/** /**
* Check if a given object implements the OuterObjectWithEnumProperty interface. * Check if a given object implements the OuterObjectWithEnumProperty interface.
*/ */
export function instanceOfOuterObjectWithEnumProperty(value: object): boolean { export function instanceOfOuterObjectWithEnumProperty(value: object): value is OuterObjectWithEnumProperty {
if (!('value' in value)) return false; if (!('value' in value) || value['value'] === undefined) return false;
return true; return true;
} }

View File

@ -47,7 +47,7 @@ export type ParentWithNullableTypeEnum = typeof ParentWithNullableTypeEnum[keyof
/** /**
* Check if a given object implements the ParentWithNullable interface. * Check if a given object implements the ParentWithNullable interface.
*/ */
export function instanceOfParentWithNullable(value: object): boolean { export function instanceOfParentWithNullable(value: object): value is ParentWithNullable {
return true; return true;
} }

View File

@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
/** /**
* Check if a given object implements the Pet interface. * Check if a given object implements the Pet interface.
*/ */
export function instanceOfPet(value: object): boolean { export function instanceOfPet(value: object): value is Pet {
if (!('name' in value)) return false; if (!('name' in value) || value['name'] === undefined) return false;
if (!('photoUrls' in value)) return false; if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface ReadOnlyFirst {
/** /**
* Check if a given object implements the ReadOnlyFirst interface. * Check if a given object implements the ReadOnlyFirst interface.
*/ */
export function instanceOfReadOnlyFirst(value: object): boolean { export function instanceOfReadOnlyFirst(value: object): value is ReadOnlyFirst {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface Return {
/** /**
* Check if a given object implements the Return interface. * Check if a given object implements the Return interface.
*/ */
export function instanceOfReturn(value: object): boolean { export function instanceOfReturn(value: object): value is Return {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface SpecialModelName {
/** /**
* Check if a given object implements the SpecialModelName interface. * Check if a given object implements the SpecialModelName interface.
*/ */
export function instanceOfSpecialModelName(value: object): boolean { export function instanceOfSpecialModelName(value: object): value is SpecialModelName {
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Tag {
/** /**
* Check if a given object implements the Tag interface. * Check if a given object implements the Tag interface.
*/ */
export function instanceOfTag(value: object): boolean { export function instanceOfTag(value: object): value is Tag {
return true; return true;
} }

View File

@ -31,7 +31,7 @@ export interface TestInlineFreeformAdditionalPropertiesRequest {
/** /**
* Check if a given object implements the TestInlineFreeformAdditionalPropertiesRequest interface. * Check if a given object implements the TestInlineFreeformAdditionalPropertiesRequest interface.
*/ */
export function instanceOfTestInlineFreeformAdditionalPropertiesRequest(value: object): boolean { export function instanceOfTestInlineFreeformAdditionalPropertiesRequest(value: object): value is TestInlineFreeformAdditionalPropertiesRequest {
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export interface User {
/** /**
* Check if a given object implements the User interface. * Check if a given object implements the User interface.
*/ */
export function instanceOfUser(value: object): boolean { export function instanceOfUser(value: object): value is User {
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Category {
/** /**
* Check if a given object implements the Category interface. * Check if a given object implements the Category interface.
*/ */
export function instanceOfCategory(value: object): boolean { export function instanceOfCategory(value: object): value is Category {
return true; return true;
} }

View File

@ -42,7 +42,7 @@ export interface ModelApiResponse {
/** /**
* Check if a given object implements the ModelApiResponse interface. * Check if a given object implements the ModelApiResponse interface.
*/ */
export function instanceOfModelApiResponse(value: object): boolean { export function instanceOfModelApiResponse(value: object): value is ModelApiResponse {
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
/** /**
* Check if a given object implements the Order interface. * Check if a given object implements the Order interface.
*/ */
export function instanceOfOrder(value: object): boolean { export function instanceOfOrder(value: object): value is Order {
return true; return true;
} }

View File

@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
/** /**
* Check if a given object implements the Pet interface. * Check if a given object implements the Pet interface.
*/ */
export function instanceOfPet(value: object): boolean { export function instanceOfPet(value: object): value is Pet {
if (!('name' in value)) return false; if (!('name' in value) || value['name'] === undefined) return false;
if (!('photoUrls' in value)) return false; if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Tag {
/** /**
* Check if a given object implements the Tag interface. * Check if a given object implements the Tag interface.
*/ */
export function instanceOfTag(value: object): boolean { export function instanceOfTag(value: object): value is Tag {
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export interface User {
/** /**
* Check if a given object implements the User interface. * Check if a given object implements the User interface.
*/ */
export function instanceOfUser(value: object): boolean { export function instanceOfUser(value: object): value is User {
return true; return true;
} }

View File

@ -61,7 +61,7 @@ export interface EnumPatternObject {
/** /**
* Check if a given object implements the EnumPatternObject interface. * Check if a given object implements the EnumPatternObject interface.
*/ */
export function instanceOfEnumPatternObject(value: object): boolean { export function instanceOfEnumPatternObject(value: object): value is EnumPatternObject {
return true; return true;
} }

View File

@ -90,7 +90,7 @@ export type FakeEnumRequestGetInline200ResponseNullableNumberEnumEnum = typeof F
/** /**
* Check if a given object implements the FakeEnumRequestGetInline200Response interface. * Check if a given object implements the FakeEnumRequestGetInline200Response interface.
*/ */
export function instanceOfFakeEnumRequestGetInline200Response(value: object): boolean { export function instanceOfFakeEnumRequestGetInline200Response(value: object): value is FakeEnumRequestGetInline200Response {
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Category {
/** /**
* Check if a given object implements the Category interface. * Check if a given object implements the Category interface.
*/ */
export function instanceOfCategory(value: object): boolean { export function instanceOfCategory(value: object): value is Category {
return true; return true;
} }

View File

@ -42,7 +42,7 @@ export interface ModelApiResponse {
/** /**
* Check if a given object implements the ModelApiResponse interface. * Check if a given object implements the ModelApiResponse interface.
*/ */
export function instanceOfModelApiResponse(value: object): boolean { export function instanceOfModelApiResponse(value: object): value is ModelApiResponse {
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
/** /**
* Check if a given object implements the Order interface. * Check if a given object implements the Order interface.
*/ */
export function instanceOfOrder(value: object): boolean { export function instanceOfOrder(value: object): value is Order {
return true; return true;
} }

View File

@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
/** /**
* Check if a given object implements the Pet interface. * Check if a given object implements the Pet interface.
*/ */
export function instanceOfPet(value: object): boolean { export function instanceOfPet(value: object): value is Pet {
if (!('name' in value)) return false; if (!('name' in value) || value['name'] === undefined) return false;
if (!('photoUrls' in value)) return false; if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Tag {
/** /**
* Check if a given object implements the Tag interface. * Check if a given object implements the Tag interface.
*/ */
export function instanceOfTag(value: object): boolean { export function instanceOfTag(value: object): value is Tag {
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export interface User {
/** /**
* Check if a given object implements the User interface. * Check if a given object implements the User interface.
*/ */
export function instanceOfUser(value: object): boolean { export function instanceOfUser(value: object): value is User {
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Category {
/** /**
* Check if a given object implements the Category interface. * Check if a given object implements the Category interface.
*/ */
export function instanceOfCategory(value: object): boolean { export function instanceOfCategory(value: object): value is Category {
return true; return true;
} }

View File

@ -42,7 +42,7 @@ export interface ModelApiResponse {
/** /**
* Check if a given object implements the ModelApiResponse interface. * Check if a given object implements the ModelApiResponse interface.
*/ */
export function instanceOfModelApiResponse(value: object): boolean { export function instanceOfModelApiResponse(value: object): value is ModelApiResponse {
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
/** /**
* Check if a given object implements the Order interface. * Check if a given object implements the Order interface.
*/ */
export function instanceOfOrder(value: object): boolean { export function instanceOfOrder(value: object): value is Order {
return true; return true;
} }

View File

@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
/** /**
* Check if a given object implements the Pet interface. * Check if a given object implements the Pet interface.
*/ */
export function instanceOfPet(value: object): boolean { export function instanceOfPet(value: object): value is Pet {
if (!('name' in value)) return false; if (!('name' in value) || value['name'] === undefined) return false;
if (!('photoUrls' in value)) return false; if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Tag {
/** /**
* Check if a given object implements the Tag interface. * Check if a given object implements the Tag interface.
*/ */
export function instanceOfTag(value: object): boolean { export function instanceOfTag(value: object): value is Tag {
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export interface User {
/** /**
* Check if a given object implements the User interface. * Check if a given object implements the User interface.
*/ */
export function instanceOfUser(value: object): boolean { export function instanceOfUser(value: object): value is User {
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Category {
/** /**
* Check if a given object implements the Category interface. * Check if a given object implements the Category interface.
*/ */
export function instanceOfCategory(value: object): boolean { export function instanceOfCategory(value: object): value is Category {
return true; return true;
} }

View File

@ -42,7 +42,7 @@ export interface ModelApiResponse {
/** /**
* Check if a given object implements the ModelApiResponse interface. * Check if a given object implements the ModelApiResponse interface.
*/ */
export function instanceOfModelApiResponse(value: object): boolean { export function instanceOfModelApiResponse(value: object): value is ModelApiResponse {
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
/** /**
* Check if a given object implements the Order interface. * Check if a given object implements the Order interface.
*/ */
export function instanceOfOrder(value: object): boolean { export function instanceOfOrder(value: object): value is Order {
return true; return true;
} }

View File

@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
/** /**
* Check if a given object implements the Pet interface. * Check if a given object implements the Pet interface.
*/ */
export function instanceOfPet(value: object): boolean { export function instanceOfPet(value: object): value is Pet {
if (!('name' in value)) return false; if (!('name' in value) || value['name'] === undefined) return false;
if (!('photoUrls' in value)) return false; if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Tag {
/** /**
* Check if a given object implements the Tag interface. * Check if a given object implements the Tag interface.
*/ */
export function instanceOfTag(value: object): boolean { export function instanceOfTag(value: object): value is Tag {
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export interface User {
/** /**
* Check if a given object implements the User interface. * Check if a given object implements the User interface.
*/ */
export function instanceOfUser(value: object): boolean { export function instanceOfUser(value: object): value is User {
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Category {
/** /**
* Check if a given object implements the Category interface. * Check if a given object implements the Category interface.
*/ */
export function instanceOfCategory(value: object): boolean { export function instanceOfCategory(value: object): value is Category {
return true; return true;
} }

View File

@ -37,8 +37,8 @@ export interface DefaultMetaOnlyResponse {
/** /**
* Check if a given object implements the DefaultMetaOnlyResponse interface. * Check if a given object implements the DefaultMetaOnlyResponse interface.
*/ */
export function instanceOfDefaultMetaOnlyResponse(value: object): boolean { export function instanceOfDefaultMetaOnlyResponse(value: object): value is DefaultMetaOnlyResponse {
if (!('meta' in value)) return false; if (!('meta' in value) || value['meta'] === undefined) return false;
return true; return true;
} }

View File

@ -49,8 +49,8 @@ export interface FindPetsByStatusResponse {
/** /**
* Check if a given object implements the FindPetsByStatusResponse interface. * Check if a given object implements the FindPetsByStatusResponse interface.
*/ */
export function instanceOfFindPetsByStatusResponse(value: object): boolean { export function instanceOfFindPetsByStatusResponse(value: object): value is FindPetsByStatusResponse {
if (!('meta' in value)) return false; if (!('meta' in value) || value['meta'] === undefined) return false;
return true; return true;
} }

View File

@ -49,8 +49,8 @@ export interface FindPetsByUserResponse {
/** /**
* Check if a given object implements the FindPetsByUserResponse interface. * Check if a given object implements the FindPetsByUserResponse interface.
*/ */
export function instanceOfFindPetsByUserResponse(value: object): boolean { export function instanceOfFindPetsByUserResponse(value: object): value is FindPetsByUserResponse {
if (!('meta' in value)) return false; if (!('meta' in value) || value['meta'] === undefined) return false;
return true; return true;
} }

View File

@ -43,8 +43,8 @@ export interface GetBehaviorPermissionsResponse {
/** /**
* Check if a given object implements the GetBehaviorPermissionsResponse interface. * Check if a given object implements the GetBehaviorPermissionsResponse interface.
*/ */
export function instanceOfGetBehaviorPermissionsResponse(value: object): boolean { export function instanceOfGetBehaviorPermissionsResponse(value: object): value is GetBehaviorPermissionsResponse {
if (!('meta' in value)) return false; if (!('meta' in value) || value['meta'] === undefined) return false;
return true; return true;
} }

View File

@ -49,8 +49,8 @@ export interface GetBehaviorTypeResponse {
/** /**
* Check if a given object implements the GetBehaviorTypeResponse interface. * Check if a given object implements the GetBehaviorTypeResponse interface.
*/ */
export function instanceOfGetBehaviorTypeResponse(value: object): boolean { export function instanceOfGetBehaviorTypeResponse(value: object): value is GetBehaviorTypeResponse {
if (!('meta' in value)) return false; if (!('meta' in value) || value['meta'] === undefined) return false;
return true; return true;
} }

View File

@ -49,8 +49,8 @@ export interface GetMatchingPartsResponse {
/** /**
* Check if a given object implements the GetMatchingPartsResponse interface. * Check if a given object implements the GetMatchingPartsResponse interface.
*/ */
export function instanceOfGetMatchingPartsResponse(value: object): boolean { export function instanceOfGetMatchingPartsResponse(value: object): value is GetMatchingPartsResponse {
if (!('meta' in value)) return false; if (!('meta' in value) || value['meta'] === undefined) return false;
return true; return true;
} }

View File

@ -49,8 +49,8 @@ export interface GetPetPartTypeResponse {
/** /**
* Check if a given object implements the GetPetPartTypeResponse interface. * Check if a given object implements the GetPetPartTypeResponse interface.
*/ */
export function instanceOfGetPetPartTypeResponse(value: object): boolean { export function instanceOfGetPetPartTypeResponse(value: object): value is GetPetPartTypeResponse {
if (!('meta' in value)) return false; if (!('meta' in value) || value['meta'] === undefined) return false;
return true; return true;
} }

View File

@ -36,9 +36,9 @@ export interface ItemId {
/** /**
* Check if a given object implements the ItemId interface. * Check if a given object implements the ItemId interface.
*/ */
export function instanceOfItemId(value: object): boolean { export function instanceOfItemId(value: object): value is ItemId {
if (!('id' in value)) return false; if (!('id' in value) || value['id'] === undefined) return false;
if (!('type' in value)) return false; if (!('type' in value) || value['type'] === undefined) return false;
return true; return true;
} }

View File

@ -43,9 +43,9 @@ export interface MatchingParts {
/** /**
* Check if a given object implements the MatchingParts interface. * Check if a given object implements the MatchingParts interface.
*/ */
export function instanceOfMatchingParts(value: object): boolean { export function instanceOfMatchingParts(value: object): value is MatchingParts {
if (!('connected' in value)) return false; if (!('connected' in value) || value['connected'] === undefined) return false;
if (!('related' in value)) return false; if (!('related' in value) || value['related'] === undefined) return false;
return true; return true;
} }

View File

@ -42,7 +42,7 @@ export interface ModelApiResponse {
/** /**
* Check if a given object implements the ModelApiResponse interface. * Check if a given object implements the ModelApiResponse interface.
*/ */
export function instanceOfModelApiResponse(value: object): boolean { export function instanceOfModelApiResponse(value: object): value is ModelApiResponse {
return true; return true;
} }

View File

@ -55,8 +55,8 @@ export interface ModelError {
/** /**
* Check if a given object implements the ModelError interface. * Check if a given object implements the ModelError interface.
*/ */
export function instanceOfModelError(value: object): boolean { export function instanceOfModelError(value: object): value is ModelError {
if (!('type' in value)) return false; if (!('type' in value) || value['type'] === undefined) return false;
return true; return true;
} }

View File

@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
/** /**
* Check if a given object implements the Order interface. * Check if a given object implements the Order interface.
*/ */
export function instanceOfOrder(value: object): boolean { export function instanceOfOrder(value: object): value is Order {
return true; return true;
} }

View File

@ -36,9 +36,9 @@ export interface Part {
/** /**
* Check if a given object implements the Part interface. * Check if a given object implements the Part interface.
*/ */
export function instanceOfPart(value: object): boolean { export function instanceOfPart(value: object): value is Part {
if (!('id' in value)) return false; if (!('id' in value) || value['id'] === undefined) return false;
if (!('name' in value)) return false; if (!('name' in value) || value['name'] === undefined) return false;
return true; return true;
} }

View File

@ -187,21 +187,21 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
/** /**
* Check if a given object implements the Pet interface. * Check if a given object implements the Pet interface.
*/ */
export function instanceOfPet(value: object): boolean { export function instanceOfPet(value: object): value is Pet {
if (!('id' in value)) return false; if (!('id' in value) || value['id'] === undefined) return false;
if (!('otherFriendIds' in value)) return false; if (!('otherFriendIds' in value) || value['otherFriendIds'] === undefined) return false;
if (!('friendAge' in value)) return false; if (!('friendAge' in value) || value['friendAge'] === undefined) return false;
if (!('age' in value)) return false; if (!('age' in value) || value['age'] === undefined) return false;
if (!('isHappy' in value)) return false; if (!('isHappy' in value) || value['isHappy'] === undefined) return false;
if (!('isTall' in value)) return false; if (!('isTall' in value) || value['isTall'] === undefined) return false;
if (!('category' in value)) return false; if (!('category' in value) || value['category'] === undefined) return false;
if (!('name' in value)) return false; if (!('name' in value) || value['name'] === undefined) return false;
if (!('photoUrls' in value)) return false; if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
if (!('warningStatus' in value)) return false; if (!('warningStatus' in value) || value['warningStatus'] === undefined) return false;
if (!('alternateStatus' in value)) return false; if (!('alternateStatus' in value) || value['alternateStatus'] === undefined) return false;
if (!('otherDepStatuses' in value)) return false; if (!('otherDepStatuses' in value) || value['otherDepStatuses'] === undefined) return false;
if (!('tags' in value)) return false; if (!('tags' in value) || value['tags'] === undefined) return false;
if (!('status' in value)) return false; if (!('status' in value) || value['status'] === undefined) return false;
return true; return true;
} }

View File

@ -43,8 +43,8 @@ export interface PetRegionsResponse {
/** /**
* Check if a given object implements the PetRegionsResponse interface. * Check if a given object implements the PetRegionsResponse interface.
*/ */
export function instanceOfPetRegionsResponse(value: object): boolean { export function instanceOfPetRegionsResponse(value: object): value is PetRegionsResponse {
if (!('meta' in value)) return false; if (!('meta' in value) || value['meta'] === undefined) return false;
return true; return true;
} }

View File

@ -99,8 +99,8 @@ export type ResponseMetaCodeEnum = typeof ResponseMetaCodeEnum[keyof typeof Resp
/** /**
* Check if a given object implements the ResponseMeta interface. * Check if a given object implements the ResponseMeta interface.
*/ */
export function instanceOfResponseMeta(value: object): boolean { export function instanceOfResponseMeta(value: object): value is ResponseMeta {
if (!('code' in value)) return false; if (!('code' in value) || value['code'] === undefined) return false;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface Tag {
/** /**
* Check if a given object implements the Tag interface. * Check if a given object implements the Tag interface.
*/ */
export function instanceOfTag(value: object): boolean { export function instanceOfTag(value: object): value is Tag {
return true; return true;
} }

View File

@ -84,9 +84,9 @@ export interface User {
/** /**
* Check if a given object implements the User interface. * Check if a given object implements the User interface.
*/ */
export function instanceOfUser(value: object): boolean { export function instanceOfUser(value: object): value is User {
if (!('id' in value)) return false; if (!('id' in value) || value['id'] === undefined) return false;
if (!('subUser2' in value)) return false; if (!('subUser2' in value) || value['subUser2'] === undefined) return false;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ export interface AdditionalPropertiesClass {
/** /**
* Check if a given object implements the AdditionalPropertiesClass interface. * Check if a given object implements the AdditionalPropertiesClass interface.
*/ */
export function instanceOfAdditionalPropertiesClass(value: object): boolean { export function instanceOfAdditionalPropertiesClass(value: object): value is AdditionalPropertiesClass {
return true; return true;
} }

View File

@ -43,7 +43,7 @@ export interface AllOfWithSingleRef {
/** /**
* Check if a given object implements the AllOfWithSingleRef interface. * Check if a given object implements the AllOfWithSingleRef interface.
*/ */
export function instanceOfAllOfWithSingleRef(value: object): boolean { export function instanceOfAllOfWithSingleRef(value: object): value is AllOfWithSingleRef {
return true; return true;
} }

View File

@ -38,8 +38,8 @@ export interface Animal {
/** /**
* Check if a given object implements the Animal interface. * Check if a given object implements the Animal interface.
*/ */
export function instanceOfAnimal(value: object): boolean { export function instanceOfAnimal(value: object): value is Animal {
if (!('className' in value)) return false; if (!('className' in value) || value['className'] === undefined) return false;
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface ArrayOfArrayOfNumberOnly {
/** /**
* Check if a given object implements the ArrayOfArrayOfNumberOnly interface. * Check if a given object implements the ArrayOfArrayOfNumberOnly interface.
*/ */
export function instanceOfArrayOfArrayOfNumberOnly(value: object): boolean { export function instanceOfArrayOfArrayOfNumberOnly(value: object): value is ArrayOfArrayOfNumberOnly {
return true; return true;
} }

View File

@ -30,7 +30,7 @@ export interface ArrayOfNumberOnly {
/** /**
* Check if a given object implements the ArrayOfNumberOnly interface. * Check if a given object implements the ArrayOfNumberOnly interface.
*/ */
export function instanceOfArrayOfNumberOnly(value: object): boolean { export function instanceOfArrayOfNumberOnly(value: object): value is ArrayOfNumberOnly {
return true; return true;
} }

View File

@ -49,7 +49,7 @@ export interface ArrayTest {
/** /**
* Check if a given object implements the ArrayTest interface. * Check if a given object implements the ArrayTest interface.
*/ */
export function instanceOfArrayTest(value: object): boolean { export function instanceOfArrayTest(value: object): value is ArrayTest {
return true; return true;
} }

Some files were not shown because too many files have changed in this diff Show More