mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-17 03:04:26 +01:00
Merge remote-tracking branch 'origin/master' into aakansha-custom-elements
This commit is contained in:
12
src/utils.ts
12
src/utils.ts
@@ -635,3 +635,15 @@ export const getCustomElementConfig = (
|
||||
}
|
||||
return customElementConfig.find((config) => config.customType === customType);
|
||||
};
|
||||
|
||||
export const isPromiseLike = (
|
||||
value: any,
|
||||
): value is Promise<ResolutionType<typeof value>> => {
|
||||
return (
|
||||
!!value &&
|
||||
typeof value === "object" &&
|
||||
"then" in value &&
|
||||
"catch" in value &&
|
||||
"finally" in value
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user