inspect-attrs
An object attributes inspect tool.
API
inspectAttrs(source: Object, rules: Object)
source
: The target objectrules
: The inspect rules
required
:Boolean
Set attr is requiredtype
:String|Array
Set attr typedefault
:Any
Set attr default valueonRequired
:String
Set custom required error message,%s
equal the attronTypeError
:String
Set custom type error message,%s
equal the attr
Example
; let options = {}; options = ;