Skip to content

Commit

Permalink
Update dependency @types/cheerio to v0.22.30 (#184)
Browse files Browse the repository at this point in the history
* Update dependency @types/cheerio to v0.22.30

* Just type it as any for now

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Mark Tutkowski <mark@tutkowski.com>
  • Loading branch information
3 people committed Jul 26, 2021
1 parent 4eea954 commit f72b3f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"ytdl-core": "4.9.0"
},
"devDependencies": {
"@types/cheerio": "0.22.22",
"@types/cheerio": "0.22.30",
"@types/ffmpeg-static": "3.0.0",
"@types/fuzzyset.js": "0.0.2",
"@types/jasmine": "3.8.1",
Expand Down
4 changes: 3 additions & 1 deletion src/newegg/newegg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export interface LotteryData {
export const shuffle = async (): Promise<LotteryData> => {
const response = await got('https://www.newegg.com/product-shuffle');
const $ = cheerio.load(response.body, { xmlMode: true });
const initialState = $('script:not([src])').filter((index, element): boolean => element.children.some((child) => child.data && child.data.includes('LotteryStartDate')))[0].children[0].data;

const html: any = $('script:not([src])');
const initialState = html.filter((index: any, element: any): boolean => element.children.some((child: any) => child.data && child.data.includes('LotteryStartDate')))[0].children[0].data;

const match = initialState.match(/\{.*\}/);
const { lotteryData } = JSON.parse(match[0]);
Expand Down

0 comments on commit f72b3f3

Please sign in to comment.