Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zhinjs/schema

zhin配置声明
https://github.com/zhinjs/schema

Last synced: about 1 month ago
JSON representation

zhin配置声明

Awesome Lists containing this project

README

        

# @zhinjs/schema
zhin配置声明
## 声明number
```javascript
Schema.number()
```
## 声明string
```javascript
Schema.string()
```
## 声明boolean
```javascript
Schema.boolean()
```
## 声明date
```javascript
Schema.date()
```
## 声明regexp
```javascript
Schema.regexp()
```
## 声明object
1. Record
```javascript
Schema.dict(
Schema.string()
)
```
2. Record
```javascript
Schema.dict(
Schema.number()
)
```
3. Record
```javascript
Schema.dict(
Schema.date()
)
```
4. Record
```javascript
Schema.dict(
Schema.list(
Schema.number()
)
)
```
5. Record
```javascript
Schema.dict(
Schema.list(
Schema.object({
foo:Schema.string(),
bar:Schema.list(Schema.number())
})
)
)
```
## 声明array
1. string[]
```javascript
Schema.array(
Schema.string()
)
```
2. {foo:number,bar:string}[]

```javascript
Schema.array(
Schema.object({
foo:Schema.number(),
bar:Schema.string()
})
)
```