(
propPaths: [
NodePath<t.JSXIdentifier> | NodePath<t.Identifier>,
NodePath<t.StringLiteral> | NodePath<t.JSXExpressionContainer>,
][]
)
| 65 | } |
| 66 | |
| 67 | export function createMessageDescriptor( |
| 68 | propPaths: [ |
| 69 | NodePath<t.JSXIdentifier> | NodePath<t.Identifier>, |
| 70 | NodePath<t.StringLiteral> | NodePath<t.JSXExpressionContainer>, |
| 71 | ][] |
| 72 | ): MessageDescriptorPath { |
| 73 | return propPaths.reduce( |
| 74 | (hash: MessageDescriptorPath, [keyPath, valuePath]) => { |
| 75 | const key = getMessageDescriptorKey( |
| 76 | keyPath |
| 77 | ) as keyof MessageDescriptorPath |
| 78 | |
| 79 | if (DESCRIPTOR_PROPS.has(key)) { |
| 80 | hash[key] = valuePath |
| 81 | } |
| 82 | |
| 83 | return hash |
| 84 | }, |
| 85 | { |
| 86 | id: undefined, |
| 87 | defaultMessage: undefined, |
| 88 | description: undefined, |
| 89 | } |
| 90 | ) |
| 91 | } |
| 92 | |
| 93 | export function evaluateMessageDescriptor( |
| 94 | descriptorPath: MessageDescriptorPath, |
no test coverage detected