convert customElementsConfig into an object

This commit is contained in:
ad1992
2022-05-04 14:26:54 +05:30
parent c93d8f4bd0
commit c4b951a0c5
9 changed files with 39 additions and 74 deletions
+1 -11
View File
@@ -11,7 +11,7 @@ import {
WINDOWS_EMOJI_FALLBACK_FONT,
} from "./constants";
import { FontFamilyValues, FontString } from "./element/types";
import { AppProps, AppState, DataURL, Zoom } from "./types";
import { AppState, DataURL, Zoom } from "./types";
import { unstable_batchedUpdates } from "react-dom";
import { isDarwin } from "./keys";
@@ -629,16 +629,6 @@ export const getFrame = () => {
}
};
export const getCustomElementConfig = (
customElementConfig: AppProps["customElementsConfig"],
customType: string,
) => {
if (!customElementConfig) {
return null;
}
return customElementConfig.find((config) => config.customType === customType);
};
export const isPromiseLike = (
value: any,
): value is Promise<ResolutionType<typeof value>> => {