fast-csv icon indicating copy to clipboard operation
fast-csv copied to clipboard

Check the event types passed to .on() [FEATURE]

Open mattboehm opened this issue 5 years ago • 0 comments

Parsing or Formatting?

  • [ ] Formatting
  • [x] Parsing

Is your feature request related to a problem? Please describe. A coworker and I just spent some time debugging their validator, only to eventually discover that they'd typed on('data.invalid') instead of on('data-invalid').

Describe the solution you'd like Override .on() to check the event type being passed to it and produce a warning for unexpected values.

Describe alternatives you've considered If the expected event types can't be easily predicted (e.g. because library users implement their own events), or if this is considered too much of an edge case, then I'd completely understand considering this a wontfix.

Additional context Just thought I'd make the suggestion in case you find it useful and it helps save others time in the future. Thanks!

mattboehm avatar Nov 20 '20 00:11 mattboehm