fix: no overloading
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
import { IframelyErrorResponse, Unfurl } from "@shared/types";
|
||||
import { Unfurl } from "@shared/types";
|
||||
|
||||
function presentUnfurl(data: any): Unfurl | IframelyErrorResponse {
|
||||
return !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,
|
||||
}
|
||||
: {
|
||||
status: data.status,
|
||||
error: data.error,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user