mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 18:12:09 +08:00
20 lines
530 B
TypeScript
20 lines
530 B
TypeScript
/**
|
|
* Unique symbol to mark Frame instances.
|
|
*
|
|
* We use a symbol because in some cases importing the Frame to do
|
|
* instanceof checks introduces circular references.
|
|
*
|
|
* Having the symbol in it's own file prevents any potential circular
|
|
* references and allows checking if an object is a frame
|
|
*/
|
|
export const FRAME_SYMBOL = Symbol('FRAME_SYMBOL');
|
|
|
|
/**
|
|
* Helper to determine if the passed object is a Frame
|
|
*
|
|
* @param object
|
|
*/
|
|
export function isFrame(object: any) {
|
|
return object && object[FRAME_SYMBOL] === true;
|
|
}
|