@param {Node | Comment} node @return {number}
(node)
| 90 | @return {number} |
| 91 | */ |
| 92 | function locEnd(node) { |
| 93 | const { type } = node; |
| 94 | |
| 95 | // Effected by children |
| 96 | if (type === "IfStatement") { |
| 97 | return locEnd(node.alternate ?? node.consequent); |
| 98 | } |
| 99 | |
| 100 | if ( |
| 101 | type === "ForInStatement" || |
| 102 | type === "ForOfStatement" || |
| 103 | type === "ForStatement" || |
| 104 | type === "LabeledStatement" || |
| 105 | type === "WithStatement" || |
| 106 | type === "WhileStatement" |
| 107 | ) { |
| 108 | return locEnd(node.body); |
| 109 | } |
| 110 | |
| 111 | return ( |
| 112 | overrides.get(type)?.( |
| 113 | // @ts-expect-error -- Comment types |
| 114 | node, |
| 115 | ) ?? locEndWithFullText(node) |
| 116 | ); |
| 117 | } |
| 118 | |
| 119 | export { locEnd, shouldAddContentEnd, shouldIgnoredNodePrintSemicolon }; |
no test coverage detected
searching dependent graphs…