Skip to content

Commit

Permalink
perf: isKaboomCtx only check if property exists
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel committed May 26, 2024
1 parent 7f79352 commit c41c057
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kaboom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ let internalCtx: InternalContext[] = [];

// TODO: A better way to detect KaboomCtx
export const isKaboomCtx = (obj: any): obj is KaboomCtx => {
return Object.keys(obj).includes("loadAseprite");
return obj && obj["loadAseprite"];
};

export const getKaboomContext = (fallBack?: any): KaboomCtx => {
Expand Down

0 comments on commit c41c057

Please sign in to comment.