Skip to content

审计参数检查

¥Audit Argument Checks

此软件包导致 Meteor 要求传递给方法和发布函数的所有参数都是 checked。任何未将其每个参数传递给 check 的方法都将引发错误,该错误将记录在服务器上,并在客户端中显示为 500 Internal server error。这是一种简单的方法,有助于确保你的应用具有完整的检查覆盖范围。

¥This package causes Meteor to require that all arguments passed to methods and publish functions are checked. Any method that does not pass each one of its arguments to check will throw an error, which will be logged on the server and which will appear to the client as a 500 Internal server error. This is a simple way to help ensure that your app has complete check coverage.

不需要验证其参数的方法和发布函数可以简单地运行 check(arguments, [Match.Any]) 来满足 audit-argument-checks 覆盖率检查器。

¥Methods and publish functions that do not need to validate their arguments can simply run check(arguments, [Match.Any]) to satisfy the audit-argument-checks coverage checker.