Created
August 23, 2017 15:56
-
-
Save JarvisPrestidge/81690e26df035a3913d4428960c3ba3c to your computer and use it in GitHub Desktop.
Conditionally add metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const meta: IStringMap<string> = {}; | |
// Conditionally add meta data if not null or undefined | |
if (Codes.transactionCategoryCodes[transaction.txnCatCde] != null) { | |
meta.transactionType = Codes.transactionCategoryCodes[transaction.txnCatCde]; | |
} | |
if (transaction.txnRefNum != null) { | |
meta.bankTransactionId = transaction.txnRefNum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment