fix: no overloading
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user