版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1 год назад
1234567891011121314151617181920212223242526272829303132
  1. # East Asian Width
  2. Get [East Asian Width](http://www.unicode.org/reports/tr11/) from a character.
  3. 'F'(Fullwidth), 'H'(Halfwidth), 'W'(Wide), 'Na'(Narrow), 'A'(Ambiguous) or 'N'(Natural).
  4. Original Code is [東アジアの文字幅 (East Asian Width) の判定 - 中途](http://d.hatena.ne.jp/takenspc/20111126#1322252878).
  5. ## Install
  6. $ npm install eastasianwidth
  7. ## Usage
  8. var eaw = require('eastasianwidth');
  9. console.log(eaw.eastAsianWidth('₩')) // 'F'
  10. console.log(eaw.eastAsianWidth('。')) // 'H'
  11. console.log(eaw.eastAsianWidth('뀀')) // 'W'
  12. console.log(eaw.eastAsianWidth('a')) // 'Na'
  13. console.log(eaw.eastAsianWidth('①')) // 'A'
  14. console.log(eaw.eastAsianWidth('ف')) // 'N'
  15. console.log(eaw.characterLength('₩')) // 2
  16. console.log(eaw.characterLength('。')) // 1
  17. console.log(eaw.characterLength('뀀')) // 2
  18. console.log(eaw.characterLength('a')) // 1
  19. console.log(eaw.characterLength('①')) // 2
  20. console.log(eaw.characterLength('ف')) // 1
  21. console.log(eaw.length('あいうえお')) // 10
  22. console.log(eaw.length('abcdefg')) // 7
  23. console.log(eaw.length('¢₩。ᅵㄅ뀀¢⟭a⊙①بف')) // 19