We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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?
The text was updated successfully, but these errors were encountered:
// @g-plane
Sorry, something went wrong.
I think as const is required. (add as const , then your ['iso_639_1', 'iso_3166_1'] can be of type ['iso_639_1', 'iso_3166_1'], rather than string[])
as const
['iso_639_1', 'iso_3166_1']
string[]
Refer to: https://github.com/sindresorhus/camelcase-keys/blob/v8.0.2/index.test-d.ts#L84
TS reference : https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions
No branches or pull requests
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.
Maybe add some generic only for return type, not only one generic for input and return type?
The text was updated successfully, but these errors were encountered: