UNPKG

294 BJavaScriptView Raw
1'use strict'
2
3function onlyRegex (pattern) {
4 var match = true
5
6 for (var key in pattern) {
7 if (pattern[key] instanceof RegExp) {
8 match = true
9 } else if (typeof pattern[key] !== 'object') {
10 match = false
11 break
12 }
13 }
14
15 return match
16}
17
18module.exports = onlyRegex