forked from loafle/openapi-generator-original
[typescript-fetch] Make instanceOf infer type and check for undefineds (#18694)
This commit is contained in:
parent
2fe397cb3e
commit
62238c6886
@ -20,10 +20,10 @@ import { {{modelName}}FromJSONTyped } from './{{modelName}}{{importFileExtension
|
||||
/**
|
||||
* 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}}
|
||||
{{#required}}
|
||||
if (!('{{name}}' in value)) return false;
|
||||
if (!('{{name}}' in value) || value['{{name}}'] === undefined) return false;
|
||||
{{/required}}
|
||||
{{/vars}}
|
||||
return true;
|
||||
|
@ -37,7 +37,7 @@ export interface Club {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface Owner {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ export interface Club {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface Owner {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface AdditionalPropertiesClass {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ export interface AllOfWithSingleRef {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,8 @@ export interface Animal {
|
||||
/**
|
||||
* Check if a given object implements the Animal interface.
|
||||
*/
|
||||
export function instanceOfAnimal(value: object): boolean {
|
||||
if (!('className' in value)) return false;
|
||||
export function instanceOfAnimal(value: object): value is Animal {
|
||||
if (!('className' in value) || value['className'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface ArrayOfArrayOfNumberOnly {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface ArrayOfNumberOnly {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ export interface ArrayTest {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ export interface Capitalization {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ export interface Cat extends Animal {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,8 @@ export interface Category {
|
||||
/**
|
||||
* Check if a given object implements the Category interface.
|
||||
*/
|
||||
export function instanceOfCategory(value: object): boolean {
|
||||
if (!('name' in value)) return false;
|
||||
export function instanceOfCategory(value: object): value is Category {
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ export interface ChildWithNullable extends ParentWithNullable {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface ClassModel {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface Client {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface DeprecatedObject {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ export interface Dog extends Animal {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeo
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -137,8 +137,8 @@ export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof
|
||||
/**
|
||||
* Check if a given object implements the EnumTest interface.
|
||||
*/
|
||||
export function instanceOfEnumTest(value: object): boolean {
|
||||
if (!('enumStringRequired' in value)) return false;
|
||||
export function instanceOfEnumTest(value: object): value is EnumTest {
|
||||
if (!('enumStringRequired' in value) || value['enumStringRequired'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface FakeBigDecimalMap200Response {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface FileSchemaTestClass {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface Foo {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ export interface FooGetDefaultResponse {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -127,11 +127,11 @@ export interface FormatTest {
|
||||
/**
|
||||
* Check if a given object implements the FormatTest interface.
|
||||
*/
|
||||
export function instanceOfFormatTest(value: object): boolean {
|
||||
if (!('number' in value)) return false;
|
||||
if (!('_byte' in value)) return false;
|
||||
if (!('date' in value)) return false;
|
||||
if (!('password' in value)) return false;
|
||||
export function instanceOfFormatTest(value: object): value is FormatTest {
|
||||
if (!('number' in value) || value['number'] === undefined) return false;
|
||||
if (!('_byte' in value) || value['_byte'] === undefined) return false;
|
||||
if (!('date' in value) || value['date'] === undefined) return false;
|
||||
if (!('password' in value) || value['password'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface HasOnlyReadOnly {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface HealthCheckResult {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface List {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ export interface MixedPropertiesAndAdditionalPropertiesClass {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Model200Response {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export interface ModelApiResponse {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface ModelFile {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,8 @@ export interface Name {
|
||||
/**
|
||||
* Check if a given object implements the Name interface.
|
||||
*/
|
||||
export function instanceOfName(value: object): boolean {
|
||||
if (!('name' in value)) return false;
|
||||
export function instanceOfName(value: object): value is Name {
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ export interface NullableClass {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface NumberOnly {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ export interface ObjectWithDeprecatedFields {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export interface OuterComposite {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,8 @@ export interface OuterObjectWithEnumProperty {
|
||||
/**
|
||||
* Check if a given object implements the OuterObjectWithEnumProperty interface.
|
||||
*/
|
||||
export function instanceOfOuterObjectWithEnumProperty(value: object): boolean {
|
||||
if (!('value' in value)) return false;
|
||||
export function instanceOfOuterObjectWithEnumProperty(value: object): value is OuterObjectWithEnumProperty {
|
||||
if (!('value' in value) || value['value'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ export type ParentWithNullableTypeEnum = typeof ParentWithNullableTypeEnum[keyof
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
/**
|
||||
* Check if a given object implements the Pet interface.
|
||||
*/
|
||||
export function instanceOfPet(value: object): boolean {
|
||||
if (!('name' in value)) return false;
|
||||
if (!('photoUrls' in value)) return false;
|
||||
export function instanceOfPet(value: object): value is Pet {
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface ReadOnlyFirst {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface Return {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface SpecialModelName {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Tag {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ export interface TestInlineFreeformAdditionalPropertiesRequest {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export interface User {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Category {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export interface ModelApiResponse {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
/**
|
||||
* Check if a given object implements the Pet interface.
|
||||
*/
|
||||
export function instanceOfPet(value: object): boolean {
|
||||
if (!('name' in value)) return false;
|
||||
if (!('photoUrls' in value)) return false;
|
||||
export function instanceOfPet(value: object): value is Pet {
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Tag {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export interface User {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ export interface EnumPatternObject {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ export type FakeEnumRequestGetInline200ResponseNullableNumberEnumEnum = typeof F
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Category {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export interface ModelApiResponse {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
/**
|
||||
* Check if a given object implements the Pet interface.
|
||||
*/
|
||||
export function instanceOfPet(value: object): boolean {
|
||||
if (!('name' in value)) return false;
|
||||
if (!('photoUrls' in value)) return false;
|
||||
export function instanceOfPet(value: object): value is Pet {
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Tag {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export interface User {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Category {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export interface ModelApiResponse {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
/**
|
||||
* Check if a given object implements the Pet interface.
|
||||
*/
|
||||
export function instanceOfPet(value: object): boolean {
|
||||
if (!('name' in value)) return false;
|
||||
if (!('photoUrls' in value)) return false;
|
||||
export function instanceOfPet(value: object): value is Pet {
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Tag {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export interface User {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Category {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export interface ModelApiResponse {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
/**
|
||||
* Check if a given object implements the Pet interface.
|
||||
*/
|
||||
export function instanceOfPet(value: object): boolean {
|
||||
if (!('name' in value)) return false;
|
||||
if (!('photoUrls' in value)) return false;
|
||||
export function instanceOfPet(value: object): value is Pet {
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Tag {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export interface User {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Category {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,8 @@ export interface DefaultMetaOnlyResponse {
|
||||
/**
|
||||
* Check if a given object implements the DefaultMetaOnlyResponse interface.
|
||||
*/
|
||||
export function instanceOfDefaultMetaOnlyResponse(value: object): boolean {
|
||||
if (!('meta' in value)) return false;
|
||||
export function instanceOfDefaultMetaOnlyResponse(value: object): value is DefaultMetaOnlyResponse {
|
||||
if (!('meta' in value) || value['meta'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -49,8 +49,8 @@ export interface FindPetsByStatusResponse {
|
||||
/**
|
||||
* Check if a given object implements the FindPetsByStatusResponse interface.
|
||||
*/
|
||||
export function instanceOfFindPetsByStatusResponse(value: object): boolean {
|
||||
if (!('meta' in value)) return false;
|
||||
export function instanceOfFindPetsByStatusResponse(value: object): value is FindPetsByStatusResponse {
|
||||
if (!('meta' in value) || value['meta'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -49,8 +49,8 @@ export interface FindPetsByUserResponse {
|
||||
/**
|
||||
* Check if a given object implements the FindPetsByUserResponse interface.
|
||||
*/
|
||||
export function instanceOfFindPetsByUserResponse(value: object): boolean {
|
||||
if (!('meta' in value)) return false;
|
||||
export function instanceOfFindPetsByUserResponse(value: object): value is FindPetsByUserResponse {
|
||||
if (!('meta' in value) || value['meta'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,8 @@ export interface GetBehaviorPermissionsResponse {
|
||||
/**
|
||||
* Check if a given object implements the GetBehaviorPermissionsResponse interface.
|
||||
*/
|
||||
export function instanceOfGetBehaviorPermissionsResponse(value: object): boolean {
|
||||
if (!('meta' in value)) return false;
|
||||
export function instanceOfGetBehaviorPermissionsResponse(value: object): value is GetBehaviorPermissionsResponse {
|
||||
if (!('meta' in value) || value['meta'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -49,8 +49,8 @@ export interface GetBehaviorTypeResponse {
|
||||
/**
|
||||
* Check if a given object implements the GetBehaviorTypeResponse interface.
|
||||
*/
|
||||
export function instanceOfGetBehaviorTypeResponse(value: object): boolean {
|
||||
if (!('meta' in value)) return false;
|
||||
export function instanceOfGetBehaviorTypeResponse(value: object): value is GetBehaviorTypeResponse {
|
||||
if (!('meta' in value) || value['meta'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -49,8 +49,8 @@ export interface GetMatchingPartsResponse {
|
||||
/**
|
||||
* Check if a given object implements the GetMatchingPartsResponse interface.
|
||||
*/
|
||||
export function instanceOfGetMatchingPartsResponse(value: object): boolean {
|
||||
if (!('meta' in value)) return false;
|
||||
export function instanceOfGetMatchingPartsResponse(value: object): value is GetMatchingPartsResponse {
|
||||
if (!('meta' in value) || value['meta'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -49,8 +49,8 @@ export interface GetPetPartTypeResponse {
|
||||
/**
|
||||
* Check if a given object implements the GetPetPartTypeResponse interface.
|
||||
*/
|
||||
export function instanceOfGetPetPartTypeResponse(value: object): boolean {
|
||||
if (!('meta' in value)) return false;
|
||||
export function instanceOfGetPetPartTypeResponse(value: object): value is GetPetPartTypeResponse {
|
||||
if (!('meta' in value) || value['meta'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,9 +36,9 @@ export interface ItemId {
|
||||
/**
|
||||
* Check if a given object implements the ItemId interface.
|
||||
*/
|
||||
export function instanceOfItemId(value: object): boolean {
|
||||
if (!('id' in value)) return false;
|
||||
if (!('type' in value)) return false;
|
||||
export function instanceOfItemId(value: object): value is ItemId {
|
||||
if (!('id' in value) || value['id'] === undefined) return false;
|
||||
if (!('type' in value) || value['type'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -43,9 +43,9 @@ export interface MatchingParts {
|
||||
/**
|
||||
* Check if a given object implements the MatchingParts interface.
|
||||
*/
|
||||
export function instanceOfMatchingParts(value: object): boolean {
|
||||
if (!('connected' in value)) return false;
|
||||
if (!('related' in value)) return false;
|
||||
export function instanceOfMatchingParts(value: object): value is MatchingParts {
|
||||
if (!('connected' in value) || value['connected'] === undefined) return false;
|
||||
if (!('related' in value) || value['related'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export interface ModelApiResponse {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -55,8 +55,8 @@ export interface ModelError {
|
||||
/**
|
||||
* Check if a given object implements the ModelError interface.
|
||||
*/
|
||||
export function instanceOfModelError(value: object): boolean {
|
||||
if (!('type' in value)) return false;
|
||||
export function instanceOfModelError(value: object): value is ModelError {
|
||||
if (!('type' in value) || value['type'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -36,9 +36,9 @@ export interface Part {
|
||||
/**
|
||||
* Check if a given object implements the Part interface.
|
||||
*/
|
||||
export function instanceOfPart(value: object): boolean {
|
||||
if (!('id' in value)) return false;
|
||||
if (!('name' in value)) return false;
|
||||
export function instanceOfPart(value: object): value is Part {
|
||||
if (!('id' in value) || value['id'] === undefined) return false;
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -187,21 +187,21 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
/**
|
||||
* Check if a given object implements the Pet interface.
|
||||
*/
|
||||
export function instanceOfPet(value: object): boolean {
|
||||
if (!('id' in value)) return false;
|
||||
if (!('otherFriendIds' in value)) return false;
|
||||
if (!('friendAge' in value)) return false;
|
||||
if (!('age' in value)) return false;
|
||||
if (!('isHappy' in value)) return false;
|
||||
if (!('isTall' in value)) return false;
|
||||
if (!('category' in value)) return false;
|
||||
if (!('name' in value)) return false;
|
||||
if (!('photoUrls' in value)) return false;
|
||||
if (!('warningStatus' in value)) return false;
|
||||
if (!('alternateStatus' in value)) return false;
|
||||
if (!('otherDepStatuses' in value)) return false;
|
||||
if (!('tags' in value)) return false;
|
||||
if (!('status' in value)) return false;
|
||||
export function instanceOfPet(value: object): value is Pet {
|
||||
if (!('id' in value) || value['id'] === undefined) return false;
|
||||
if (!('otherFriendIds' in value) || value['otherFriendIds'] === undefined) return false;
|
||||
if (!('friendAge' in value) || value['friendAge'] === undefined) return false;
|
||||
if (!('age' in value) || value['age'] === undefined) return false;
|
||||
if (!('isHappy' in value) || value['isHappy'] === undefined) return false;
|
||||
if (!('isTall' in value) || value['isTall'] === undefined) return false;
|
||||
if (!('category' in value) || value['category'] === undefined) return false;
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false;
|
||||
if (!('warningStatus' in value) || value['warningStatus'] === undefined) return false;
|
||||
if (!('alternateStatus' in value) || value['alternateStatus'] === undefined) return false;
|
||||
if (!('otherDepStatuses' in value) || value['otherDepStatuses'] === undefined) return false;
|
||||
if (!('tags' in value) || value['tags'] === undefined) return false;
|
||||
if (!('status' in value) || value['status'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,8 @@ export interface PetRegionsResponse {
|
||||
/**
|
||||
* Check if a given object implements the PetRegionsResponse interface.
|
||||
*/
|
||||
export function instanceOfPetRegionsResponse(value: object): boolean {
|
||||
if (!('meta' in value)) return false;
|
||||
export function instanceOfPetRegionsResponse(value: object): value is PetRegionsResponse {
|
||||
if (!('meta' in value) || value['meta'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -99,8 +99,8 @@ export type ResponseMetaCodeEnum = typeof ResponseMetaCodeEnum[keyof typeof Resp
|
||||
/**
|
||||
* Check if a given object implements the ResponseMeta interface.
|
||||
*/
|
||||
export function instanceOfResponseMeta(value: object): boolean {
|
||||
if (!('code' in value)) return false;
|
||||
export function instanceOfResponseMeta(value: object): value is ResponseMeta {
|
||||
if (!('code' in value) || value['code'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface Tag {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -84,9 +84,9 @@ export interface User {
|
||||
/**
|
||||
* Check if a given object implements the User interface.
|
||||
*/
|
||||
export function instanceOfUser(value: object): boolean {
|
||||
if (!('id' in value)) return false;
|
||||
if (!('subUser2' in value)) return false;
|
||||
export function instanceOfUser(value: object): value is User {
|
||||
if (!('id' in value) || value['id'] === undefined) return false;
|
||||
if (!('subUser2' in value) || value['subUser2'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export interface AdditionalPropertiesClass {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ export interface AllOfWithSingleRef {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,8 @@ export interface Animal {
|
||||
/**
|
||||
* Check if a given object implements the Animal interface.
|
||||
*/
|
||||
export function instanceOfAnimal(value: object): boolean {
|
||||
if (!('className' in value)) return false;
|
||||
export function instanceOfAnimal(value: object): value is Animal {
|
||||
if (!('className' in value) || value['className'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface ArrayOfArrayOfNumberOnly {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ export interface ArrayOfNumberOnly {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ export interface ArrayTest {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user