I have class with types for my object and I using convert to camel case like that with exclude keys:
camelcaseKeys(data, { exclude: ['iso_639_1', 'iso_3166_1'], deep: true });
Data after formatting camelcaseKeys is normal, but ts see like iso keys on camel cases to iso6391.
export declare class MovieDetails {
id: number;
budget: number;
imdb_id: string | null;
images: Images
genres: Genre[];
spoken_languages: Language[];
overview: string | null;
poster_path: string | null;
production_companies: Company[];
production_countries: Country[];
revenue: number;
runtime: number;
status: string;
tagline: string;
belongs_to_collection: Collection | null;
title: string;
homepage: string | null;
original_title: string;
adult: boolean;
release_date: string;
keywords: {
keywords: Keyword[];
};
credits: MovieCredits;
lists: ListData<MovieListItem>;
videos: Videos;
recommendations: ListData<MoviesListItem>;
backdrop_path: string;
original_language: string;
popularity: number;
vote_count: number;
video: boolean;
vote_average: number;
}
export declare class Language {
iso_639_1: string;
name: string;
}
export declare class Images {
backdrops: Image[];
posters: Image[];
logos: Image[];
}
export declare class Image {
aspect_ratio: number;
file_path: string;
height: number;
iso_639_1: string | null;
vote_average: number;
vote_count: number;
width: number;
}
and etc...
Maybe add some generic only for return type, not only one generic for input and return type?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too