Skip to content

Commit 21e77f8

Browse files
ezewerJacobPlaster
authored andcommitted
Add array validator
1 parent 4a9fdd2 commit 21e77f8

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lib/validators/array.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict'
2+
3+
/**
4+
* Validates a bool
5+
*
6+
* @param {*} v - value
7+
* @returns {string} error - null if valid
8+
*/
9+
module.exports = (v) => (!Array.isArray(v)
10+
? 'must be an array'
11+
: null
12+
)

0 commit comments

Comments
 (0)