Skip to content

Commit

Permalink
docs(README): PC matters
Browse files Browse the repository at this point in the history
  • Loading branch information
twada committed Jul 7, 2016
1 parent 6c09dfb commit eea4a50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/power-assert-util-string-width/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ var stringWidth = require('power-assert-util-string-width');
stringWidth('abcde'); //=> 5
stringWidth('あいうえお'); //=> 10
stringWidth('アイウエオ'); //=> 5
stringWidth('ただしイケメンに限る'); //=> 22
stringWidth('脚注'); //=> 6
// stringWidth.narrow treats ambiguous-width characters as narrow (= `1`)
stringWidth.narrow('ただしイケメンに限る'); //=> 21
stringWidth.narrow('脚注'); //=> 5
```


Expand Down
6 changes: 3 additions & 3 deletions packages/power-assert-util-string-width/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ describe('stringWidth', function () {

describe('ambiguous EastAsianWidth', function () {
beforeEach(function () {
this.strWithAmbiguousEastAsian = '※ただしイケメンに限る';
this.strWithAmbiguousEastAsian = '※脚注';
});
it('Treat ambiguous-width characters as fullwidth (= `2`) by default.', function () {
assert.equal(stringWidth(this.strWithAmbiguousEastAsian), 22);
assert.equal(stringWidth(this.strWithAmbiguousEastAsian), 6);
});
it('stringWidth.narrow treats ambiguous-width characters as narrow (= `1`)', function () {
assert.equal(stringWidth.narrow(this.strWithAmbiguousEastAsian), 21);
assert.equal(stringWidth.narrow(this.strWithAmbiguousEastAsian), 5);
});
});

0 comments on commit eea4a50

Please sign in to comment.