Skip to content

Commit

Permalink
refactor(types): 🏷️ update Element type in tests due to Cheerio update
Browse files Browse the repository at this point in the history
  • Loading branch information
djdembeck committed Nov 19, 2024
1 parent 9af2f64 commit c183173
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/helpers/utils/shared.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as cheerio from 'cheerio'
import { Element } from 'domhandler'
import { htmlToText } from 'html-to-text'
import lodash from 'lodash'

Expand Down Expand Up @@ -38,7 +39,7 @@ class SharedHelper {
*/
collectGenres(
asin: string,
genres: cheerio.Cheerio<cheerio.Element>[],
genres: cheerio.Cheerio<Element>[],
type: string
): ApiGenre[] {
// Check and label each genre
Expand Down Expand Up @@ -113,10 +114,10 @@ class SharedHelper {
* @param {string} selector the selector to extract from
* @returns {cheerio.Cheerio<cheerio.Element>[]} the genres from the selector
*/
getGenresFromHtml(dom: cheerio.CheerioAPI, selector: string): cheerio.Cheerio<cheerio.Element>[] {
getGenresFromHtml(dom: cheerio.CheerioAPI, selector: string): cheerio.Cheerio<Element>[] {
return dom(selector)
.toArray()
.map((element) => dom(element)) as cheerio.Cheerio<cheerio.Element>[]
.map((element) => dom(element)) as cheerio.Cheerio<Element>[]
}

/**
Expand Down

0 comments on commit c183173

Please sign in to comment.