New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+ Param for String.localeCompare should be a string. #161

Merged
merged 1 commit into from Sep 30, 2017

Conversation

Projects
None yet
3 participants
@LancerComet
Contributor

LancerComet commented Sep 22, 2017

String.localeCompare 应该接受 string 类型, 而 pinyinB 为一个 string[].

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Sep 22, 2017

Coverage Status

Coverage remained the same at 99.961% when pulling f4a9fdf on LancerComet:hotfix/compare into 7407b65 on hotoo:master.

coveralls commented Sep 22, 2017

Coverage Status

Coverage remained the same at 99.961% when pulling f4a9fdf on LancerComet:hotfix/compare into 7407b65 on hotoo:master.

@@ -181,7 +181,7 @@ class Pinyin {
compare (hanA, hanB) {
const pinyinA = this.convert(hanA, DEFAULT_OPTIONS);
const pinyinB = this.convert(hanB, DEFAULT_OPTIONS);
return String(pinyinA).localeCompare(pinyinB);
return String(pinyinA).localeCompare(String(pinyinB));

This comment has been minimized.

@hotoo

hotoo Sep 30, 2017

Owner

localeCompare 的参数其实默认会转换成 String 类型,这个加不加其实是一样的。

@hotoo

hotoo Sep 30, 2017

Owner

localeCompare 的参数其实默认会转换成 String 类型,这个加不加其实是一样的。

This comment has been minimized.

@LancerComet

LancerComet Sep 30, 2017

Contributor

因为把代码引入到 TypeScript 的环境中出现报错,所以做了一个修改 ☺

@LancerComet

LancerComet Sep 30, 2017

Contributor

因为把代码引入到 TypeScript 的环境中出现报错,所以做了一个修改 ☺

@hotoo hotoo merged commit d245b12 into hotoo:master Sep 30, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 99.961%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment