Options
All
  • Public
  • Public/Protected
  • All
Menu

shoshiki

テキストを整形したり判定したりするユーティリティ

インストール

npm install @maboroshi/shoshiki

or

yarn add @maboroshi/shoshiki

使い方

import { numToCommaSeparated } from '@maboroshi/shoshiki'

console.log(numToCommaSeparated(1234)) // => 1,234

API

API ドキュメント を見る

Index

Functions

hiraganaToZenkakuKatakana

  • hiraganaToZenkakuKatakana(str: string): string

isEMailAddress

  • isEMailAddress(str: string): boolean

isJapanesePhoneNumber

  • isJapanesePhoneNumber(str: string, withoutHyphens?: boolean): boolean
  • 文字列が日本国内の電話番号であるか否かを返す

    see

    テストケース

    Parameters

    • str: string

      判定対象文字列

    • Default value withoutHyphens: boolean = false

      ハイフンを含まない文字列であるか否か

    Returns boolean

isJapanesePhoneNumberWithoutHyphens

  • isJapanesePhoneNumberWithoutHyphens(str: string): boolean

nlToBr

  • nlToBr(str: string, keepLine?: boolean): string
  • 文字列に含まれる改行コードを <br> 要素に変換する

    Parameters

    • str: string

      整形したい文字列

    • Default value keepLine: boolean = false

      改行コードを残すか否か

    Returns string

numToCommaSeparated

  • numToCommaSeparated(num: number): string
  • 数値をカンマ区切りの文字列に整形する

    Parameters

    • num: number

      整形したい数値

    Returns string

zenkakuAlphaNumSymbolToHankaku

  • zenkakuAlphaNumSymbolToHankaku(str: string): string

zenkakuKatakanaToHiragana

  • zenkakuKatakanaToHiragana(str: string): string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc