src/utils/removeNode.js/removeNode
export function removeNode ( code, parent, node ) {
	const key = keys[ parent.type ];
	const offset = offsets[ parent.type ];
	if ( !key || !offset ) throw new Error( `not implemented: ${parent.type}` );

	const list = parent[ key ];
	const i = list.indexOf( node );
	if ( i === -1 ) throw new Error( 'node not in list' );

	let a;
	let b;

	if ( list.length === 1 ) {
		// remove everything, leave {}
		a = parent.start + offset[0];
		b = parent.end + offset[1];
	} else if ( i === 0 ) {
		// remove everything before second node, including comments
		a = parent.start + offset[0];
		while ( /\s/.test( code.original[a] ) ) a += 1;

		b = list[i].end;
		while ( /[\s,]/.test( code.original[b] ) ) b += 1;
	} else {
		// remove the end of the previous node to the end of this one
		a = list[ i - 1 ].end;
		b = node.end;
	}

	code.remove( a, b );
	list.splice( i, 1 );
	return;
}