improve(buffer): stringify all properties since they can be different types (unsure why now)

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-02-04 14:46:58 +01:00
parent afef578389
commit b0a41f7911

View File

@@ -34,7 +34,7 @@ export class ProfileBuffer extends BaseBuffer {
// Fast-path for primitives
if (obj === null || type !== 'object') {
return obj;
return String(obj);
}
// Fast-path for arrays - process values only
@@ -57,7 +57,9 @@ export class ProfileBuffer extends BaseBuffer {
const key = sortedKeys[i]!;
const value = obj[key];
result[key] =
value && typeof value === 'object' ? this.sortObjectKeys(value) : value;
value && typeof value === 'object'
? this.sortObjectKeys(value)
: String(value);
}
return result;