UNPKG

@gateway.fm/gtw-dvf-client-js

Version:

DVF client js lib with gateway.fm rpc endpoints

14 lines (13 loc) 385 B
/** * * @param {Object} orderIdOrCid 'xxx' or { orderId: 'xxx' } or { cid: 'yyy' } */ module.exports = orderIdOrCid => { if (typeof orderIdOrCid === 'object' && orderIdOrCid !== null) { const { cid, orderId } = orderIdOrCid return cid ? { cid } : { orderId } } else { // Supporting input to be orderId as original behavior return { orderId: orderIdOrCid } } }