tabby-ai-assistant 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -191,7 +191,13 @@ export function secureCompare(a: any, b: any): boolean {
|
|
|
191
191
|
|
|
192
192
|
let result = 0;
|
|
193
193
|
for (let i = 0; i < strA.length; i++) {
|
|
194
|
-
|
|
194
|
+
const codeA = strA.charCodeAt(i);
|
|
195
|
+
const codeB = strB.charCodeAt(i);
|
|
196
|
+
// 确保charCodeAt返回有效值
|
|
197
|
+
if (typeof codeA !== 'number' || typeof codeB !== 'number') {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
result |= codeA ^ codeB;
|
|
195
201
|
}
|
|
196
202
|
|
|
197
203
|
return result === 0;
|