How to use the @mojaloop/central-services-shared.Util.mergeAndOmitNil function in @mojaloop/central-services-shared

To help you get started, we’ve selected a few @mojaloop/central-services-shared examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mojaloop / central-ledger / src / domain / transfer / transform.js View on Github external
const fromTransferAggregate = (t) => {
  const cleanProperties = Util.omitNil({
    transferId: t.transferId,
    amount: formatAmount(t.amount),
    // transferState: Util.omitNil(t.transferState),
    transferState: t.transferState,
    completedTimestamp: t.completedTimestamp,
    ilpPacket: t.ilpPacket,
    condition: t.condition,
    fulfilment: t.fulfilment,
    expiration: t.expirationDate,
    extensionList: formatExtensionList(t.extensionList)
  })
  return Util.mergeAndOmitNil(Util.pick(t, transferProperties), cleanProperties)
}
github mojaloop / central-ledger / src / domain / transfer / transform.js View on Github external
const formatAmount = (asset) => Util.mergeAndOmitNil(asset, {
  amount: Util.formatAmount(asset.amount),
  currency: asset.currency
})