fix: no overloading

This commit is contained in:
Apoorv Mishra
2023-07-25 08:51:34 +05:30
parent 2a17e0cbf6
commit 03ebca2f0c
2 changed files with 10 additions and 20 deletions

View File

@@ -1,19 +1,14 @@
import { IframelyErrorResponse, Unfurl } from "@shared/types";
import { Unfurl } from "@shared/types";
function presentUnfurl(data: any): Unfurl | IframelyErrorResponse {
return !data.error
? {
url: data.url,
type: data.type,
title: data.title,
description: data.description,
thumbnailUrl: data.thumbnail_url,
meta: data.meta,
}
: {
status: data.status,
error: data.error,
};
function presentUnfurl(data: any): Unfurl {
return {
url: data.url,
type: data.type,
title: data.title,
description: data.description,
thumbnailUrl: data.thumbnail_url,
meta: data.meta,
};
}
export default presentUnfurl;

View File

@@ -225,10 +225,5 @@ export type Unfurl<T = OEmbedType> = {
meta?: Record<string, string>;
};
export type IframelyErrorResponse = {
status: number;
error: string;
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type ProsemirrorData = Record<string, any>;