Skip to content

Commit

Permalink
Update type of Document returned by xmldom parser (#1599)
Browse files Browse the repository at this point in the history
Signed-off-by: Marvin A. Ruder <signed@mruder.dev>
  • Loading branch information
marvinruder authored Sep 22, 2024
1 parent 04a1f31 commit 71b1b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/fetch/fetch.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
isIndividualDataProvider,
resourcesAPIPath,
} from "@rating-tracker/commons";
import type { Document } from "@xmldom/xmldom";
import { DOMParser, MIME_TYPE } from "@xmldom/xmldom";

import type ResourceService from "../resource/resource.service";
Expand Down Expand Up @@ -413,8 +414,7 @@ class FetchService {
);
},
});
// We are expecting an HTML document here, so we can safely cast the result to a `Document`
const document = parser.parseFromString(responseData, MIME_TYPE.HTML) as unknown as Document;
const document = parser.parseFromString(responseData, MIME_TYPE.HTML);
if (error)
throw new DataProviderError(`Error while fetching HTML page: ${error.message}`, {
cause: error,
Expand Down

0 comments on commit 71b1b35

Please sign in to comment.