example/bundle.js
// remove an object from this node
remove an object from this node
remove an object from this node
function remove(node, obj, attr) {
        if( !attr )
            attr = false
        else if( typeof attr != 'string' )
            attr = 'id'
        var count = 0
        for( var ci = 0; ci < node.c.length; ci++ )
            if( ( attr && node.c[ci][attr] == obj[attr] ) ||
                ( !attr && isequal(node.c[ci], obj) ) ) {
                count++
                removeItems(node.c, ci, 1)
                ci--
            }
        for( var ci = 0; ci < node.l.length; ci++ )
            if( ( attr && node.l[ci][attr] == obj[attr] ) ||
                ( !attr && isequal(node.l[ci], obj) ) ) {
                count++
                removeItems(node.l, ci, 1)
                ci--
            }
        var leaf = isleaf(node, obj)
        if( !leaf.leaf && leaf.childnode )
            return count + remove(leaf.childnode, obj, attr)
        return count
    }
function remove ( node , obj , attr ) { if ( ! attr ) attr = false else if ( typeof attr != 'string' ) attr = 'id' var count = 0 for ( var ci = 0 ; ci < node . c . length ; ci ++ ) if ( ( attr && node . c [ ci ] [ attr ] == obj [ attr ] ) || ( ! attr && isequal ( node . c [ ci ] , obj ) ) ) { count ++ removeItems ( node . c , ci , 1 ) ci -- } for ( var ci = 0 ; ci < node . l . length ; ci ++ ) if ( ( attr && node . l [ ci ] [ attr ] == obj [ attr ] ) || ( ! attr && isequal ( node . l [ ci ] , obj ) ) ) { count ++ removeItems ( node . l , ci , 1 ) ci -- } var leaf = isleaf ( node , obj ) if ( ! leaf . leaf && leaf . childnode ) return count + remove ( leaf . childnode , obj , attr ) return count }
remove an object from this node
remove an object from this node