Skip to content

Conversation

coolme200
Copy link
Contributor

No description provided.

@coolme200
Copy link
Contributor Author

先看下这个重构方式,测试用例我再考虑下。

if (typeof type === 'string') {
type = {
name: type,
valid: foo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

foo 这个名字有点怪异啊

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那叫 doNothing ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore?

@dead-horse
Copy link
Member

@coolme200 看一下刚才说的那几个问题,其他都ok

@coolme200
Copy link
Contributor Author

好,我看下。

@dead-horse
Copy link
Member

+1

dead-horse added a commit that referenced this pull request Jan 22, 2015
feat(valid): #5 support valid & Null valud
@dead-horse dead-horse merged commit f04e706 into master Jan 22, 2015
@dead-horse
Copy link
Member

突然发现一个问题,这里做完强制类型转换,排查问题也比较麻烦啊,如果把 string 转成了 int 变成 NaN 的时候会出现什么状况

@coolme200
Copy link
Contributor Author

如果是 NaN 的话好办,会跟不做类型转换的时候报一样的错,序列化失败。

另外排查问题的一般方法是先拿客户端请求过去的内容和服务端接收到的数据进行比较,如果发现不一致再往下查,问题还是比较容易定位的。

@dead-horse
Copy link
Member

ok 先这样吧,我发个2.0.0

@dead-horse dead-horse deleted the valid branch January 22, 2015 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants