fmtEvent.js 450 B

1234567891011121314
  1. /* eslint-disable @typescript-eslint/no-explicit-any */
  2. export default function fmtEvent(props, e) {
  3. if (e === void 0) { e = {}; }
  4. var dataset = {};
  5. for (var key in props) {
  6. if (/data-/gi.test(key)) {
  7. dataset[key.replace(/data-/gi, '')] = props[key];
  8. }
  9. }
  10. return Object.assign({}, e, {
  11. currentTarget: { dataset: dataset },
  12. target: { dataset: dataset, targetDataset: dataset },
  13. });
  14. }