/**
 * Convert string into hankaku.
 * @function lib.string.toHankaku
 * @param {string} str - String to convert.
 * @returns {string} Hankaku string.
 */
var _patterns = require('./_patterns');

module.exports = function (str) {
    return str && str.replace(_patterns.ZENKAKU, function ($0) {
        return String.fromCharCode($0.charCodeAt(0) - 0xFEE0);
    });
};