public/code.js
/**
 * Returns true if the node is nested inside an instance. It does not include the instance itself.
 * @param {SceneNode} node A node you want to check
 * @returns Returns true if inside an instance
 */
Returns true if the node is nested inside an instance. It does not include the instance itself.
@param {SceneNode} node A node you want to check
@returns Returns true if inside an instance
Returns true if the node is nested inside an instance . It does not include the instance itself . @param { SceneNode } node A node you want to check @returns Returns true if inside an instance
function isInsideInstance(node) {
    const parent = node.parent;
    if (parent) {
        if (parent && parent.type === 'INSTANCE') {
            return true;
        }
        else if (parent && parent.type === 'PAGE') {
            return false;
        }
        else {
            return isInsideInstance(parent);
        }
    }
    else {
        return false;
    }
}
function isInsideInstance ( node ) { const parent = node . parent ; if ( parent ) { if ( parent && parent . type === 'INSTANCE' ) { return true ; } else if ( parent && parent . type === 'PAGE' ) { return false ; } else { return isInsideInstance ( parent ) ; } } else { return false ; } }
Returns true if the node is nested inside an instance.
Returns true if the node is nested inside an instance .
// Sometimes parent is null