var accents = require('remove-accents');

const dropAccent = (data, feed, ctx) => {
  if (ctx.isLast()) {
    return feed.close();
  }
  const defval = ctx.getParam('valeurParDefaut', 'n/a')
  const curval = data.value || defval;
  data.value = accents.remove(curval);
  return feed.send(data);
};

exports.default = {
  dropAccent,
};
