fix(patches): skip version-mismatched patch targets

- check patch versions before opening target files
- add the home-v2 empty response check patch #862
This commit is contained in:
amd64fox
2026-05-30 22:06:22 +03:00
parent 49d6db9448
commit b53956f71d
2 changed files with 99 additions and 38 deletions
+8
View File
@@ -2583,6 +2583,14 @@
},
"match": "(typeName\\])",
"replace": "$1 || []"
},
"fixHomeV2EmptyResponseCheck": {
"version": {
"fr": "1.1.92",
"to": "1.2.45"
},
"match": "(\"HomeResponsePayload\"[\\s\\S]{0,500}?)0\\s*===\\s*([A-Za-z_$][\\w$]*)\\.sectionContainer\\.sections\\.totalCount\\s*\\|\\|\\s*0\\s*===\\s*\\2\\.sectionContainer\\.sections\\.items\\.length",
"replace": "$1!Array.isArray(null==$2||null==$2.sectionContainer||null==$2.sectionContainer.sections?void 0:$2.sectionContainer.sections.items)||0===$2.sectionContainer.sections.items.length"
}
},
"VariousJs": {