dist/commonjs/cleanup.js
function rdelete(m, key) {
    if (m.parent && m.parent.filename === require.resolve(key)) {
        delete m.parent;
    }
    for (var i = m.children.length - 1; i >= 0; i--) {
        if (m.children[i].filename === require.resolve(key)) {
            m.children.splice(i, 1);
        }
        else {
            rdelete(m.children[i], key);
        }
    }
}
function rdelete(m, key) {
    if (m.parent && m.parent.filename === require.resolve(key)) {
        delete m.parent;
    }
    for (var i = m.children.length - 1; i >= 0; i--) {
        if (m.children[i].filename === require.resolve(key)) {
            m.children.splice(i, 1);
        }
        else {
            rdelete(m.children[i], key);
        }
    }
}
function rdelete ( m , key ) { if ( m . parent && m . parent . filename === require . resolve ( key ) ) { delete m . parent ; } for ( var i = m . children . length - 1 ; i >= 0 ; i -- ) { if ( m . children [ i ] . filename === require . resolve ( key ) ) { m . children . splice ( i , 1 ) ; } else { rdelete ( m . children [ i ] , key ) ; } } }
Recursively go over all node modules and delete a specific module
so it can be garbage collected
@param m
@param key
Recursively go over all node modules and delete a specific module so it can be garbage collected