lib/addons/bem.js
function getBlockName(node, lookup, prefix) {
	let depth = prefix.length > 1 ? prefix.length : 0;

	// NB don’t walk up to root node, stay at first root child in case of
	// too deep prefix
	while (node.parent && node.parent.parent && depth--) {
		node = node.parent;
	}

	return lookup.get(node) || '';
}
function getBlockName(node, lookup, prefix) {
	let depth = prefix.length > 1 ? prefix.length : 0;

	// NB don’t walk up to root node, stay at first root child in case of
	// too deep prefix
	while (node.parent && node.parent.parent && depth--) {
		node = node.parent;
	}

	return lookup.get(node) || '';
}
function getBlockName ( node , lookup , prefix ) { let depth = prefix . length > 1 ? prefix . length : 0 ; // NB don’t walk up to root node, stay at first root child in case of // too deep prefix while ( node . parent && node . parent . parent && depth -- ) { node = node . parent ; } return lookup . get ( node ) || '' ; }
Returns block name for given `node` by `prefix`, which tells the depth of
of parent node lookup
@param  {Node} node
@param  {Map} lookup
@param  {String} prefix
@return {String}
Returns block name for given node by prefix which tells the depth of of parent node lookup