How to use the wanakana.isJapanese function in wanakana

To help you get started, we’ve selected a few wanakana examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kaniwani / kw-frontend / app / features / search / SearchBarContainer / SearchBar.js View on Github external
onSubmit: ({ searchInput }, dispatch) => {
    if (isMixed(searchInput) || isEmpty(searchInput)) {
      // TODO: notify? shake? color searchbar?
      console.warn('Invalid search input');
      return false;
    }
    const payload = {
      meaningContains: isRomaji(searchInput) ? searchInput : '',
      readingContains: isJapanese(searchInput) ? searchInput : '',
    };
    return dispatch(app.review.search.request(payload));
  },
})(SearchBar);
github Kaniwani / kw-frontend / app / features / search / SearchBar.js View on Github external
onSubmit: ({ keywords }, dispatch, form) => {
    if (isMixed(keywords)) {
      form.stopSubmit({ keywords: 'Mixed input' });
    } else {
      const query = {};
      if (isRomaji(keywords)) {
        query.meaningContains = keywords.toLowerCase();
      } else if (isJapanese(keywords)) {
        query.readingContains = keywords;
      }
      dispatch(search.query.request(query, { form }));
    }
  },
})(SearchBar);
github Kaniwani / kw-frontend / app / containers / SessionPage / logic.js View on Github external
const isInputValid = (input = '') => !isEmpty(input) && isJapanese(input);
const cleanseInput = (input = '') => fixTerminalN(input.trim());
github Kaniwani / kw-frontend / app / features / quiz / QuizSession / QuizAnswer / utils.js View on Github external
export const isInputValid = (input = '') =>
  !containsZenkakuLatin(input) && isJapanese(input, /[0-9]/);
export const cleanseInput = (input = '') => fixTerminalN(input.trim());
github Kaniwani / kw-frontend / app / shared / validations.js View on Github external
export const onlyKanjiKana = (value = '') =>
  isJapanese(value) ? undefined : 'Must be a mix of kanji and okurigana';
github Kaniwani / kw-frontend / app / old / containers / QuizPage / logic.js View on Github external
const isInputValid = (input = '') => !isEmpty(input) && isJapanese(input);
const cleanseInput = (input = '') => fixTerminalN(input.trim());
github Kaniwani / kw-frontend / app / common / validations.js View on Github external
export const onlyKanjiKana = (value = '') => isJapanese(value) ? undefined : 'Must be a mix of kanji and okurigana';