Merge pull request #176 from alibaba/copilot/sub-pr-173-another-one

refactor: use Object.keys() instead of for...in in matchAttributes
This commit is contained in:
Simon
2026-03-09 22:33:56 +08:00
committed by GitHub

View File

@@ -88,7 +88,7 @@ function matchAttributes(
for (const pattern of patterns) {
if (pattern.includes('*')) {
const regex = globToRegex(pattern)
for (const key in attrs) {
for (const key of Object.keys(attrs)) {
if (regex.test(key) && attrs[key].trim()) {
result[key] = attrs[key].trim()
}