Skip to content

Commit

Permalink
feat: update certain types for readability and other types' paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoshRitesh12 committed Oct 4, 2024
1 parent aee3b6d commit cd26d97
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/utils/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
Top10Anime,
MostPopularAnime,
Top10AnimeTimePeriod,
} from "../types/anime.js";
} from "../hianime/types/anime.js";
import {
genresIdMap,
languageIdMap,
Expand All @@ -16,15 +16,15 @@ import {
typeIdMap,
} from "./constants.js";
import type { CheerioAPI, SelectorType } from "cheerio";
import type { FilterKeys } from "../types/animeSearch.js";
import type { FilterKeys } from "../hianime/types/animeSearch.js";

export const extractAnimes = (
$: CheerioAPI,
selector: SelectorType,
scraperName: string
): Array<Anime> => {
): Anime[] => {
try {
const animes: Array<Anime> = [];
const animes: Anime[] = [];

$(selector).each((_, el) => {
const animeId =
Expand Down Expand Up @@ -92,9 +92,9 @@ export const extractTop10Animes = (
$: CheerioAPI,
period: Top10AnimeTimePeriod,
scraperName: string
): Array<Top10Anime> => {
): Top10Anime[] => {
try {
const animes: Array<Top10Anime> = [];
const animes: Top10Anime[] = [];
const selector = `#top-viewed-${period} ul li`;

$(selector).each((_, el) => {
Expand Down Expand Up @@ -146,9 +146,9 @@ export const extractMostPopularAnimes = (
$: CheerioAPI,
selector: SelectorType,
scraperName: string
): Array<MostPopularAnime> => {
): MostPopularAnime[] => {
try {
const animes: Array<MostPopularAnime> = [];
const animes: MostPopularAnime[] = [];

$(selector).each((_, el) => {
animes.push({
Expand Down

0 comments on commit cd26d97

Please sign in to comment.