fantasticfiasco /期望
用Typescr ipt编写的提供参数验证的Node.js库。
目录
超级简单易用
import * as expect from 'fantasticfiasco/expect' ;
function update ( person ) {
expect . toExist ( person . name ) ;
expect . toBeTrue ( person . age >= 0 , 'existential theor
守卫
Guard是一个流利的参数验证库,它直观,快速且可扩展。
$ dotnet add package Dawn.Guard / PM> Install-Package Dawn.Guard
介绍
这是一个在没有Guard的情况下验证其参数的示例构造函数:
public Person ( string name , int age )
{
if ( name == null )
throw new ArgumentNullException ( nameo