lib/custom.js
function prepareContents(tokens) {
	let contents = new Map

	for (let i = 0, len = tokens.length; i < len; i++) {
		let token = tokens[i]

		if (token.type === 'element' && token.name === 'eh-content') {
			// Find attribute 'name'
			let name = getNameAttributeValue(token),
				arr = getArr(name)

			for (let j = 0, len2 = token.children.length; j < len2; j++) {
				arr.push(token.children[j])
			}
		} else {
			getArr('').push(token)
		}
	}

	/**
	 * @param {string} name
	 * @returns {Array<Token>}
	 */
	function getArr(name) {
		if (!contents.has(name)) {
			let arr = []
			contents.set(name, arr)
			return arr
		}
		return contents.get(name)
	}

	return contents
}
function prepareContents(tokens) {
	let contents = new Map

	for (let i = 0, len = tokens.length; i < len; i++) {
		let token = tokens[i]

		if (token.type === 'element' && token.name === 'eh-content') {
			// Find attribute 'name'
			let name = getNameAttributeValue(token),
				arr = getArr(name)

			for (let j = 0, len2 = token.children.length; j < len2; j++) {
				arr.push(token.children[j])
			}
		} else {
			getArr('').push(token)
		}
	}

	/**
	 * @param {string} name
	 * @returns {Array<Token>}
	 */
	function getArr(name) {
		if (!contents.has(name)) {
			let arr = []
			contents.set(name, arr)
			return arr
		}
		return contents.get(name)
	}

	return contents
}
function prepareContents ( tokens ) { let contents = new Map for ( let i = 0 , len = tokens . length ; i < len ; i ++ ) { let token = tokens [ i ] if ( token . type === 'element' && token . name === 'eh-content' ) { // Find attribute 'name' let name = getNameAttributeValue ( token ) , arr = getArr ( name ) for ( let j = 0 , len2 = token . children . length ; j < len2 ; j ++ ) { arr . push ( token . children [ j ] ) } } else { getArr ( '' ) . push ( token ) } } /**
	 * @param {string} name
	 * @returns {Array<Token>}
	 */ function getArr ( name ) { if ( ! contents . has ( name ) ) { let arr = [ ] contents . set ( name , arr ) return arr } return contents . get ( name ) } return contents }
Split children tokens by content name
@param {Array<Token>} tokens
@returns {Map<string, Array<Token>>}
Split children tokens by content name