Skip to content

Commit 24a32f4

Browse files
committed
ts: make resourceType check predicates more type strict.
1 parent f6f8c62 commit 24a32f4

154 files changed

Lines changed: 154 additions & 154 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/typescript-r4/fhir-types/hl7-fhir-r4-core/Account.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ export interface Account extends DomainResource {
4545
subject?: Reference<"Device" | "HealthcareService" | "Location" | "Organization" | "Patient" | "Practitioner" | "PractitionerRole">[];
4646
type?: CodeableConcept;
4747
}
48-
export const isAccount = (resource: any): resource is Account => {
48+
export const isAccount = (resource: unknown): resource is Account => {
4949
return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Account";
5050
}

examples/typescript-r4/fhir-types/hl7-fhir-r4-core/ActivityDefinition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ export interface ActivityDefinition extends DomainResource {
126126
version?: string;
127127
_version?: Element;
128128
}
129-
export const isActivityDefinition = (resource: any): resource is ActivityDefinition => {
129+
export const isActivityDefinition = (resource: unknown): resource is ActivityDefinition => {
130130
return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "ActivityDefinition";
131131
}

examples/typescript-r4/fhir-types/hl7-fhir-r4-core/AdverseEvent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ export interface AdverseEvent extends DomainResource {
5454
subjectMedicalHistory?: Reference<"AllergyIntolerance" | "Condition" | "DocumentReference" | "FamilyMemberHistory" | "Immunization" | "Media" | "Observation" | "Procedure">[];
5555
suspectEntity?: AdverseEventSuspectEntity[];
5656
}
57-
export const isAdverseEvent = (resource: any): resource is AdverseEvent => {
57+
export const isAdverseEvent = (resource: unknown): resource is AdverseEvent => {
5858
return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "AdverseEvent";
5959
}

examples/typescript-r4/fhir-types/hl7-fhir-r4-core/AllergyIntolerance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ export interface AllergyIntolerance extends DomainResource {
6363
_type?: Element;
6464
verificationStatus?: CodeableConcept;
6565
}
66-
export const isAllergyIntolerance = (resource: any): resource is AllergyIntolerance => {
66+
export const isAllergyIntolerance = (resource: unknown): resource is AllergyIntolerance => {
6767
return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "AllergyIntolerance";
6868
}

examples/typescript-r4/fhir-types/hl7-fhir-r4-core/Appointment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ export interface Appointment extends DomainResource {
5959
_status?: Element;
6060
supportingInformation?: Reference<"Resource">[];
6161
}
62-
export const isAppointment = (resource: any): resource is Appointment => {
62+
export const isAppointment = (resource: unknown): resource is Appointment => {
6363
return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Appointment";
6464
}

examples/typescript-r4/fhir-types/hl7-fhir-r4-core/AppointmentResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ export interface AppointmentResponse extends DomainResource {
2828
start?: string;
2929
_start?: Element;
3030
}
31-
export const isAppointmentResponse = (resource: any): resource is AppointmentResponse => {
31+
export const isAppointmentResponse = (resource: unknown): resource is AppointmentResponse => {
3232
return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "AppointmentResponse";
3333
}

examples/typescript-r4/fhir-types/hl7-fhir-r4-core/AuditEvent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ export interface AuditEvent extends DomainResource {
7878
subtype?: Coding[];
7979
type: Coding;
8080
}
81-
export const isAuditEvent = (resource: any): resource is AuditEvent => {
81+
export const isAuditEvent = (resource: unknown): resource is AuditEvent => {
8282
return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "AuditEvent";
8383
}

examples/typescript-r4/fhir-types/hl7-fhir-r4-core/Basic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ export interface Basic extends DomainResource {
2222
identifier?: Identifier[];
2323
subject?: Reference<"Resource">;
2424
}
25-
export const isBasic = (resource: any): resource is Basic => {
25+
export const isBasic = (resource: unknown): resource is Basic => {
2626
return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Basic";
2727
}

examples/typescript-r4/fhir-types/hl7-fhir-r4-core/Binary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ export interface Binary extends Resource {
1717
_data?: Element;
1818
securityContext?: Reference<"Resource">;
1919
}
20-
export const isBinary = (resource: any): resource is Binary => {
20+
export const isBinary = (resource: unknown): resource is Binary => {
2121
return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "Binary";
2222
}

examples/typescript-r4/fhir-types/hl7-fhir-r4-core/BiologicallyDerivedProduct.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ export interface BiologicallyDerivedProduct extends DomainResource {
6262
_status?: Element;
6363
storage?: BiologicallyDerivedProductStorage[];
6464
}
65-
export const isBiologicallyDerivedProduct = (resource: any): resource is BiologicallyDerivedProduct => {
65+
export const isBiologicallyDerivedProduct = (resource: unknown): resource is BiologicallyDerivedProduct => {
6666
return resource !== null && typeof resource === "object" && (resource as {resourceType: string}).resourceType === "BiologicallyDerivedProduct";
6767
}

0 commit comments

Comments
 (0)