函数参数验证 Ow

码农软件 · 软件分类 · 常用JavaScript包 · 2019-04-04 13:41:28

软件介绍

为人类设计的的函数参数验证。

特性

  • 富有表现力的可链接 API

  • 大量内置验证

  • 支持自定义验证

  • 用 TypeScript 编写

使用

import ow from 'ow';

const unicorn = input => {
	ow(input, ow.string.minLength(5));

	// …
};

unicorn(3);
//=> ArgumentError: Expected argument to be of type `string` but received type `number`

unicorn('yo');
//=> ArgumentError: Expected string to have a minimum length of `5`, got `yo`

本文地址:https://codercto.com/soft/d/2842.html

New Dark Age

New Dark Age

James Bridle / Verso Books / 2018-7-17 / GBP 16.99

As the world around us increases in technological complexity, our understanding of it diminishes. Underlying this trend is a single idea: the belief that our existence is understandable through comput......一起来看看 《New Dark Age》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具