(
path?:
| NodePath<t.StringLiteral>
| NodePath<t.JSXExpressionContainer>
| NodePath<t.TemplateLiteral>,
isMessageNode?: boolean
)
| 41 | } |
| 42 | |
| 43 | function getMessageDescriptorValue( |
| 44 | path?: |
| 45 | | NodePath<t.StringLiteral> |
| 46 | | NodePath<t.JSXExpressionContainer> |
| 47 | | NodePath<t.TemplateLiteral>, |
| 48 | isMessageNode?: boolean |
| 49 | ) { |
| 50 | if (!path) { |
| 51 | return '' |
| 52 | } |
| 53 | if (path.isJSXExpressionContainer()) { |
| 54 | // If this is already compiled, no need to recompiled it |
| 55 | if (isMessageNode && path.get('expression').isArrayExpression()) { |
| 56 | return '' |
| 57 | } |
| 58 | path = path.get('expression') as NodePath<t.StringLiteral> |
| 59 | } |
| 60 | |
| 61 | // Always trim the Message Descriptor values. |
| 62 | const descriptorValue = evaluatePath(path) |
| 63 | |
| 64 | return descriptorValue |
| 65 | } |
| 66 | |
| 67 | export function createMessageDescriptor( |
| 68 | propPaths: [ |
no test coverage detected