We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
试着用了koa的框架集成进来 做一个参数验证的中间件 试了几次 发现静态的数据传过去没有问题 但是通过路由传来的数据貌似不起作用 随后发现源代码中 validate的这个方法检查属性用的是hasownproperty 这个方法 不能检查对象原型链中的属性 于是将hasownproperty 换成了 key in obj 才可以使用
var has = key in obj
The text was updated successfully, but these errors were encountered:
什么情况下真实的参数会在原型链上而不再对象上? 能否举个实际例子?
Sorry, something went wrong.
No branches or pull requests
试着用了koa的框架集成进来 做一个参数验证的中间件 试了几次 发现静态的数据传过去没有问题
但是通过路由传来的数据貌似不起作用
随后发现源代码中 validate的这个方法检查属性用的是hasownproperty 这个方法 不能检查对象原型链中的属性
于是将hasownproperty 换成了 key in obj 才可以使用
var has = key in obj
The text was updated successfully, but these errors were encountered: