feat: add aftermath module with war aftermath logic and related types

This commit is contained in:
2025-12-30 10:40:30 +00:00
parent b0c4f84656
commit 97439f64a9
5 changed files with 907 additions and 0 deletions
+20
View File
@@ -154,3 +154,23 @@ export const sortConflict = (
return ordered;
};
export const simpleSerialize = (...values: Array<string | number>): string => {
const result: string[] = [];
for (const value of values) {
if (typeof value === 'string') {
result.push(`str(${value.length},${value})`);
continue;
}
if (Number.isInteger(value)) {
result.push(`int(${value})`);
continue;
}
const floatValue = value.toLocaleString('en-US', {
maximumFractionDigits: 6,
useGrouping: false,
});
result.push(`float(${floatValue})`);
}
return result.join('|');
};