(obj: typescript.ObjectLiteralExpression)
| 161 | const edits: DescriptionEdit[] = []; |
| 162 | |
| 163 | const visitObject = (obj: typescript.ObjectLiteralExpression) => { |
| 164 | for (const prop of obj.properties) { |
| 165 | if (!typescript.isPropertyAssignment(prop)) { |
| 166 | continue; |
| 167 | } |
| 168 | const name = getPropertyName(prop.name); |
| 169 | if (name === 'description') { |
| 170 | const init = prop.initializer; |
| 171 | if (typescript.isStringLiteral(init) || typescript.isNoSubstitutionTemplateLiteral(init)) { |
| 172 | edits.push({ |
| 173 | start: init.getStart(sourceFile), |
| 174 | end: init.getEnd(), |
| 175 | raw: init.text, |
| 176 | }); |
| 177 | } |
| 178 | } else if (['ja', 'zh', 'zh-TW'].includes(name) && typescript.isObjectLiteralExpression(prop.initializer)) { |
| 179 | visitObject(prop.initializer); |
| 180 | } |
| 181 | } |
| 182 | }; |
| 183 | |
| 184 | for (const stmt of sourceFile.statements) { |
| 185 | if (!typescript.isVariableStatement(stmt)) { |
no test coverage detected