From c18317395057027f35234828187f578f48c19dc4 Mon Sep 17 00:00:00 2001 From: djdembeck Date: Tue, 19 Nov 2024 15:41:34 -0600 Subject: [PATCH] refactor(types): :label: update `Element` type in tests due to Cheerio update https://cheerio.js.org/blog/cheerio-1.0 --- src/helpers/utils/shared.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/helpers/utils/shared.ts b/src/helpers/utils/shared.ts index e356257f..ed2c7b37 100644 --- a/src/helpers/utils/shared.ts +++ b/src/helpers/utils/shared.ts @@ -1,4 +1,5 @@ import * as cheerio from 'cheerio' +import { Element } from 'domhandler' import { htmlToText } from 'html-to-text' import lodash from 'lodash' @@ -38,7 +39,7 @@ class SharedHelper { */ collectGenres( asin: string, - genres: cheerio.Cheerio[], + genres: cheerio.Cheerio[], type: string ): ApiGenre[] { // Check and label each genre @@ -113,10 +114,10 @@ class SharedHelper { * @param {string} selector the selector to extract from * @returns {cheerio.Cheerio[]} the genres from the selector */ - getGenresFromHtml(dom: cheerio.CheerioAPI, selector: string): cheerio.Cheerio[] { + getGenresFromHtml(dom: cheerio.CheerioAPI, selector: string): cheerio.Cheerio[] { return dom(selector) .toArray() - .map((element) => dom(element)) as cheerio.Cheerio[] + .map((element) => dom(element)) as cheerio.Cheerio[] } /**