Skip to content

Runrioter/zawu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zawu

npm Travis branch Codecov branch

zawu => 杂物

Install

Run npm i zawu -S

Usage

const zawu = require('zawu');

const phoneNumber = '15212345678';

if (zawu.isValidPhoneNumber(phoneNumber)) {
  //...
} else {
  //...
}

API

  • isValidPhoneNumber to validate if the phone number is a good formatted in China.
    • #isValidPhoneNumber('15212345678')
  • isCJKChar to validate if a char is a cjk char
    • #isCJKChar('杂')
  • isCJKString to validate if a string is a cjk string
    • #isCJKString('杂物')
  • isCJKStringWithLength to validate if a string is a cjk string with n length
    • #isCJKStringWithLength('杂物' ,2)