You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to exclude key with start of "_" camelcaseKeys(object, { deep: true, exclude: [/^\_/ig] });
However, I found that some of keys has not follow that rule because the lastIndex of the regex has changed when it test the keys one by one and make it fail to test.
I have rewrite the "has" function to solve this problemfunction has(array, key) { return array.some(x => { if (typeof x === 'string') return x === key; else { x.lastIndex = 0; return x.test(key) } }); }
I am wondering if there has any better solution and if it can fix it in next version. thanks
The text was updated successfully, but these errors were encountered:
I would like to exclude key with start of "_"
camelcaseKeys(object, { deep: true, exclude: [/^\_/ig] });
However, I found that some of keys has not follow that rule because the lastIndex of the regex has changed when it test the keys one by one and make it fail to test.
I have rewrite the "has" function to solve this problem
function has(array, key) { return array.some(x => { if (typeof x === 'string') return x === key; else { x.lastIndex = 0; return x.test(key) } }); }
I am wondering if there has any better solution and if it can fix it in next version. thanks
The text was updated successfully, but these errors were encountered: