added certifactions and configurations, util function for constructing image paths
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import TMDB from './tmdb';
|
||||
|
||||
export * from './types';
|
||||
export * from './utils';
|
||||
|
||||
export default TMDB;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Person } from './';
|
||||
|
||||
export interface CreditSeason {
|
||||
air_date?: string;
|
||||
@@ -93,10 +93,3 @@ export interface ExternalIds {
|
||||
twitter_id: string;
|
||||
id: number;
|
||||
}
|
||||
|
||||
|
||||
export {
|
||||
certs,
|
||||
credits,
|
||||
changes,
|
||||
};
|
||||
@@ -6,7 +6,11 @@
|
||||
* @param {string} baseUrl base image url
|
||||
* @param {string} fileSize file size
|
||||
* @param {string} imagePath raw image path
|
||||
* @param {boolean} svg get svg version if true
|
||||
*/
|
||||
export const getFullImagePath = (baseUrl: string, fileSize: string, imagePath: string): string => {
|
||||
return `${baseUrl}${fileSize}${imagePath}`;
|
||||
export const getFullImagePath = (baseUrl: string, fileSize: string, imagePath: string, svg = false): string => {
|
||||
const imagePathArr = imagePath.split('.');
|
||||
const imageFormat = svg ? 'svg' : imagePathArr[1];
|
||||
|
||||
return `${baseUrl}${fileSize}${imagePathArr[0]}.${imageFormat}`;
|
||||
};
|
||||
|
||||
1
src/utils/index.ts
Normal file
1
src/utils/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './getImagePath';
|
||||
Reference in New Issue
Block a user