(annotations)
| 69 | }; |
| 70 | |
| 71 | function serializeAnnotations(annotations) { |
| 72 | if (!annotations?.length) return ''; |
| 73 | return ( |
| 74 | annotations |
| 75 | .map((a) => { |
| 76 | if (a.value === undefined) return `@${a.name}`; |
| 77 | if (a.value.includes('\n')) { |
| 78 | return `@${a.name}('''\n${indentString(a.value)}\n''')`; |
| 79 | } |
| 80 | const quote = a.value.includes('\'') ? '"' : '\''; |
| 81 | return `@${a.name}(${quote}${a.value}${quote})`; |
| 82 | }) |
| 83 | .join('\n') + '\n' |
| 84 | ); |
| 85 | }; |
| 86 | |
| 87 | module.exports = { |
| 88 | safeParseJson, |
no test coverage detected