diff --git a/packages/fetch-api/src/normalize/gif.ts b/packages/fetch-api/src/normalize/gif.ts index 2c4ba5d1..920d25ba 100644 --- a/packages/fetch-api/src/normalize/gif.ts +++ b/packages/fetch-api/src/normalize/gif.ts @@ -1,4 +1,4 @@ -import { IGif, PingbackEventType } from '@giphy/js-types' +import { IGif } from '@giphy/js-types' import { GifResult, GifsResult } from '../result-types' /** @@ -29,7 +29,7 @@ type Tag = { text: string } // tags sometimes are objects that have a text prop, sometimes they're strings const getTag = (tag: Tag | string) => (typeof tag === 'string' ? (tag as string) : (tag as Tag).text) -const normalize = (gif: any, responseId: string = '', pingbackType: PingbackEventType = '') => { +const normalize = (gif: any, responseId: string = '') => { const newGif: IGif = { ...gif } newGif.id = String(newGif.id) newGif.tags = (newGif.tags || []).map(getTag) @@ -38,11 +38,8 @@ const normalize = (gif: any, responseId: string = '', pingbackType: PingbackEven } if (responseId) { newGif.response_id = responseId - // @ts-ignore - newGif.pingbackType = pingbackType } newGif.response_id = responseId - newGif.pingback_event_type = pingbackType BOOL_PROPS.forEach(makeBool(newGif)) Object.keys(newGif.images || {}).forEach((name: string) => { const img = newGif.images[name] @@ -62,17 +59,17 @@ const normalize = (gif: any, responseId: string = '', pingbackType: PingbackEven /** * @hidden */ -export const normalizeGif = (result: GifResult, pingbackType?: PingbackEventType) => { +export const normalizeGif = (result: GifResult) => { const { response_id } = result.meta - result.data = normalize(result.data, response_id, pingbackType) + result.data = normalize(result.data, response_id) return result } /** * @hidden */ -export const normalizeGifs = (result: GifsResult, pingbackType?: PingbackEventType) => { +export const normalizeGifs = (result: GifsResult) => { const { response_id } = result.meta - result.data = result.data.map((gif) => normalize(gif, response_id, pingbackType)) + result.data = result.data.map((gif) => normalize(gif, response_id)) return result }