Skip to content

Commit

Permalink
Remove obsolete @ts-expect-error
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-mp committed Sep 25, 2024
1 parent d0d3c90 commit 986284b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 26 deletions.
6 changes: 0 additions & 6 deletions src/Migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,17 +410,13 @@ export class Migration<TDocuments extends PrismicDocument = PrismicDocument> {
// ID needs to be 16 characters long to be considered valid by the API
id: "_____broken_____",
isBroken: true,
// TODO: Remove when link text PR is merged
// @ts-expect-error - Future-proofing for link text
text: input.text,
}
}

return {
link_type: LinkType.Document,
id: () => this._getByOriginalID(input.id),
// TODO: Remove when link text PR is merged
// @ts-expect-error - Future-proofing for link text
text: input.text,
}
}
Expand All @@ -429,8 +425,6 @@ export class Migration<TDocuments extends PrismicDocument = PrismicDocument> {
return {
link_type: LinkType.Media,
id: this.createAsset(input),
// TODO: Remove when link text PR is merged
// @ts-expect-error - Future-proofing for link text
text: input.text,
}
}
Expand Down
11 changes: 1 addition & 10 deletions src/types/migration/Asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,7 @@ export type MigrationLinkToMedia = Pick<
LinkToMediaField<"filled">,
"link_type"
> &
Partial<
Pick<
LinkToMediaField<"filled">,
// TODO: Remove when link text PR is merged
// @ts-expect-error - Future-proofing for link text
"text"
>
> & {
Partial<Pick<LinkToMediaField<"filled">, "text">> & {
/**
* A reference to the migration asset used to resolve the link to media
* field's value.
Expand All @@ -95,8 +88,6 @@ export type MigrationLinkToMedia = Pick<
* with the migration API.
*/
export type MigrationLinkToMediaField =
// TODO: Remove when link text PR is merged
// @ts-expect-error - Future-proofing for link text
| Pick<LinkToMediaField<"filled">, "link_type" | "id" | "text">
| EmptyLinkField<"Media">

Expand Down
9 changes: 1 addition & 8 deletions src/types/migration/ContentRelationship.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ export type MigrationContentRelationship<
> =
| ValueOrThunk<TDocuments | PrismicMigrationDocument<TDocuments> | undefined>
| (Pick<FilledContentRelationshipField, "link_type"> &
Partial<
Pick<
FilledContentRelationshipField,
// TODO: Remove when link text PR is merged
// @ts-expect-error - Future-proofing for link text
"text"
>
> & {
Partial<Pick<FilledContentRelationshipField, "text">> & {
id: ValueOrThunk<
TDocuments | PrismicMigrationDocument<TDocuments> | undefined
>
Expand Down
2 changes: 0 additions & 2 deletions test/writeClient-migrate-patch-linkToMedia.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const assetToLinkToMedia = (
size: `${asset.size}`,
height: typeof asset.height === "number" ? `${asset.height}` : undefined,
width: typeof asset.width === "number" ? `${asset.width}` : undefined,
// TODO: Remove when link text PR is merged
// @ts-expect-error - Future-proofing for link text
text,
}
}
Expand Down

0 comments on commit 986284b

Please sign in to comment.