regexp

 function normalizeDataKey(key) {

    return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
  }

  console.log(normalizeDataKey("denisDupont")) // denis-dupont