Object modified

by amitrdx

JavaScript

let x = BACKGROUND_PRODUCT_TYPE = {
  NotSet: -1,
  BackgroundSsn: 87,
  BackgroundSsassni9: 140,
  BackgroundAddress: 88,
  BackgroundCriminalCounty7Year: 89,
  BackgroundCriminalState7Year: 90,
  BackgroundCriminalFelony7Year: 91,
  BackgroundMvr: 93,
  BackgroundEducation: 98,
  BackgroundEmployment: 99,
  BackgroundMvrTranscribed: 100,
  BackgroundReferenceCheck: 101,
  BackgroundProfessionalLicense: 102,
  BackgroundPatriotAct: 104,
  BackgroundInstantCriminal: 103,
  BackgroundSsnAddressTrace: 108,
  BackgroundDotHistory: 113,
  BackgroundEmployeeCredit: 125,
  BackgroundCivilCounty: 130,
  BackgroundCivilFederal: 131,
  BackgroundVisaVerification: 134,
  BackgroundNationalOig: 136,
  BackgroundUsSexOffender: 257,
  BackgroundFmcsaSafetyHistory: 260,
  BackgroundWantsWarrants: 265,
  BackgroundDotPreviousEmployerCheck: 280,
  BackgroundCriminalInternational: 279,
  BackgroundWorkersComp: 284,
  BackgroundTwicVerification: 441,
  BackgroundCdlis: 778,
  BackgroundMilitary: 817,
  BackgroundMedEx: 902,
  BackgroundPsp: 928,
  BackgroundJailTracker: 948
}

let y = {}
Object.keys(x).forEach(k => {
  let p = {
    name: k,
    id: x[k]
  }
  y[k]=p
})
console.log(JSON.stringify(y))