4 module.exports = function(statement /*: postcss$node*/) /*: boolean*/ {
5 const parentNode = statement.parent;
7 if (parentNode === undefined || parentNode.type === "root") {
11 if (statement === parentNode.first) {
16 * Search for the statement in the parent's nodes, ignoring comment
17 * nodes on the same line as the parent's opening brace.
20 const parentNodes = parentNode.nodes;
21 const firstNode = parentNodes[0];
23 if (firstNode.type !== "comment" || firstNode.raws.before.includes("\n")) {
27 const openingBraceLine = firstNode.source.start.line;
29 if (openingBraceLine !== firstNode.source.end.line) {
33 for (let i = 1; i < parentNodes.length; i++) {
34 const node = parentNodes[i];
36 if (node === statement) {
40 if (node.type !== "comment" || node.source.end.line !== openingBraceLine) {
45 /* istanbul ignore next: Should always return in the loop */