hotfix/array-check-contains-type #19
@ -61,6 +61,7 @@ class TypeArray extends Base {
|
|||||||
if (this._min !== null && value.length < this._min) return `value length < ${this._min}`
|
if (this._min !== null && value.length < this._min) return `value length < ${this._min}`
|
||||||
if (this._max !== null && value.length > this._max) return `value length > ${this._max}`
|
if (this._max !== null && value.length > this._max) return `value length > ${this._max}`
|
||||||
|
|
||||||
|
if (this._itemTypes.length > 0) {
|
||||||
for (const item of value) {
|
for (const item of value) {
|
||||||
let verified = false
|
let verified = false
|
||||||
let fail = ''
|
let fail = ''
|
||||||
@ -76,6 +77,7 @@ class TypeArray extends Base {
|
|||||||
}
|
}
|
||||||
if (!verified || fail) return fail || `item type not match`
|
if (!verified || fail) return fail || `item type not match`
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user