How to use the wanakana.isRomaji 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 / containers / SearchBar / index.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 / 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);