refactor: use Object.keys() instead of for...in in matchAttributes
Co-authored-by: gaomeng1900 <10131203+gaomeng1900@users.noreply.github.com>
This commit is contained in:
@@ -88,7 +88,7 @@ function matchAttributes(
|
|||||||
for (const pattern of patterns) {
|
for (const pattern of patterns) {
|
||||||
if (pattern.includes('*')) {
|
if (pattern.includes('*')) {
|
||||||
const regex = globToRegex(pattern)
|
const regex = globToRegex(pattern)
|
||||||
for (const key in attrs) {
|
for (const key of Object.keys(attrs)) {
|
||||||
if (regex.test(key) && attrs[key].trim()) {
|
if (regex.test(key) && attrs[key].trim()) {
|
||||||
result[key] = attrs[key].trim()
|
result[key] = attrs[key].trim()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user