src/utils/dom.js
/**
 * Automagically replaces input values with converted text to kana
 * @param  {defaultOptions} [options] user config overrides, default conversion is toKana()
 * @return {Function} event handler with bound options
 * @private
 */
Automagically replaces input values with converted text to kana
@param  {defaultOptions} [options] user config overrides, default conversion is toKana()
@return {Function} event handler with bound options
@private
Automagically replaces input values with converted text to kana @param { defaultOptions } [ options ] user config overrides default conversion is toKana () @return { Function } event handler with bound options @private
function makeOnInput(options) {
  let prevInput;
  const mergedConfig = Object.assign({}, mergeWithDefaultOptions(options), {
    IMEMode: options.IMEMode || true,
  });
  const preConfiguredMap = createRomajiToKanaMap(mergedConfig);
  const triggers = [
    ...Object.keys(preConfiguredMap),
    ...Object.keys(preConfiguredMap).map((char) => char.toUpperCase()),
  ];
  return function onInput({ target }) {
    if (target.value !== prevInput && target.dataset.ignoreComposition !== 'true') {
      convertInput(target, mergedConfig, preConfiguredMap, triggers, prevInput);
    }
  };
}
function makeOnInput ( options ) { let prevInput ; const mergedConfig = Object . assign ( { } , mergeWithDefaultOptions ( options ) , { IMEMode : options . IMEMode || true , } ) ; const preConfiguredMap = createRomajiToKanaMap ( mergedConfig ) ; const triggers = [ ... Object . keys ( preConfiguredMap ) , ... Object . keys ( preConfiguredMap ) . map ( ( char ) => char . toUpperCase ( ) ) , ] ; return function onInput ( { target } ) { if ( target . value !== prevInput && target . dataset . ignoreComposition !== 'true' ) { convertInput ( target , mergedConfig , preConfiguredMap , triggers , prevInput ) ; } } ; }
Automagically replaces input values with converted text to kana
 @param  {defaultOptions} [options] user config overrides, default conversion is toKana()
 @return {Function} event handler with bound options
 @private
Automagically replaces input values with converted text to kana @param { defaultOptions } [ options ] user config overrides default conversion is toKana () @return { Function } event handler with bound options @private
// Enforce IMEMode if not already specified