@technote-space/imi-moji-converter
TypeScript icon, indicating that this package has built-in type declarations

0.1.28 • Public • Published

IMI 全角半角統一コンポーネント

npm version CI Status codecov CodeFactor License: MIT

入力文字列に含まれる全角文字を半角文字に変換した結果を返す関数、 および、 入力文字列に含まれる半角文字を全角文字に変換した結果を返す関数を提供します。

Table of Contents

Details

利用者向け情報

インストール

yarn add @technote-space/imi-moji-converter

API

toHalfWidth(string)

入力として与えられた string に含まれる全角数字を半角数字に、全角アルファベットを半角アルファベットに、全角カナを半角カナに変換した文字列を返します。

toFullWidth(string)

入力として与えられた string に含まれる半角数字を全角数字に、半角アルファベットを全角アルファベットに、半角カナを全角カナに変換した文字列を返します。

使用例

import {toHalfWidth, toFullWidth} from '@technote-space/imi-moji-converter';

console.log(toHalfWidth("あかさたな0123456789"));
console.log(toFullWidth("アカサタナ0123456789"));

Author

GitHub (Technote)
Blog

Readme

Keywords

Package Sidebar

Install

npm i @technote-space/imi-moji-converter

Weekly Downloads

166

Version

0.1.28

License

MIT

Unpacked Size

6.16 kB

Total Files

5

Last publish

Collaborators

  • technote