We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
exclude
1 parent 5f2c970 commit 5a9ce4fCopy full SHA for 5a9ce4f
index.js
@@ -3,7 +3,15 @@ const mapObj = require('map-obj');
3
const camelCase = require('camelcase');
4
const QuickLru = require('quick-lru');
5
6
-const has = (array, key) => array.some(x => typeof x === 'string' ? x === key : x.test(key));
+const has = (array, key) => array.some(x => {
7
+ if (typeof x === 'string') {
8
+ return x === key;
9
+ }
10
+
11
+ x.lastIndex = 0;
12
+ return x.test(key);
13
+});
14
15
const cache = new QuickLru({maxSize: 100000});
16
17
// Reproduces behavior from `map-obj`
0 commit comments