packages/md-to-bemjson/lib/augment.js
function augmentScope(bemNode, scope) {

    assert(typeof scope === 'string', 'options.scope must be string');

    if (bemNode.isRoot) {
        bemNode.block = scope;
    } else {
        bemNode.elem = bemNode.block;
        bemNode.elemMods = bemNode.mods;

        delete bemNode.block;
        delete bemNode.mods;
    }

    return bemNode;
}
function augmentScope(bemNode, scope) {

    assert(typeof scope === 'string', 'options.scope must be string');

    if (bemNode.isRoot) {
        bemNode.block = scope;
    } else {
        bemNode.elem = bemNode.block;
        bemNode.elemMods = bemNode.mods;

        delete bemNode.block;
        delete bemNode.mods;
    }

    return bemNode;
}
function augmentScope ( bemNode , scope ) { assert ( typeof scope === 'string' , 'options.scope must be string' ) ; if ( bemNode . isRoot ) { bemNode . block = scope ; } else { bemNode . elem = bemNode . block ; bemNode . elemMods = bemNode . mods ; delete bemNode . block ; delete bemNode . mods ; } return bemNode ; }
Replace root with scope and blocks with elems.

@param {Object} bemNode - representation of bem entity
@param {string} scope - new root block name
@returns {Object} bemNode
Replace root with scope and blocks with elems .