Function remapData

  • Remap an arrays object keys

    import { remapData } from 'helping_hand'
    const remappedData = remapData(...);

    Parameters

    • data: {}[]
    • dataMap: {}

      Returns {}[]

      Example

      This will remap the name key to firstname

      const data = [
      {
      name: 'Jason'
      }
      ]
      const dataMap = {
      firstname: 'name'
      }

      const remappedData = remapData(data, dataMap);