1 |
|
2 |
|
3 | function 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 |
|
18 | module.exports = onlyRegex
|