lib/actions/convert-data-url.js
function findTokenForPoint(parent, point, type) {
	if (!parent) {
		return null;
	}

	if (parent.type === type) {
		return parent;
	}

	for (let i = 0, il = parent.size, item; i < il; i++) {
		item = parent.item(i);
		if (containsPoint(item, point)) {
			return findTokenForPoint(item, point, type);
		}
	}
}
function findTokenForPoint(parent, point, type) {
	if (!parent) {
		return null;
	}

	if (parent.type === type) {
		return parent;
	}

	for (let i = 0, il = parent.size, item; i < il; i++) {
		item = parent.item(i);
		if (containsPoint(item, point)) {
			return findTokenForPoint(item, point, type);
		}
	}
}
function findTokenForPoint ( parent , point , type ) { if ( ! parent ) { return null ; } if ( parent . type === type ) { return parent ; } for ( let i = 0 , il = parent . size , item ; i < il ; i ++ ) { item = parent . item ( i ) ; if ( containsPoint ( item , point ) ) { return findTokenForPoint ( item , point , type ) ; } } }
Finds first deeply nested token of given `type` that contains given `point`
@param  {Token}  parent Parent CSS token
@param  {Point}  point
@param  {String} type   Token type to find
@return {Token}
Finds first deeply nested token of given type that contains given point