/**
 * Rolls through each entry in a given object and creates a formatted string.
 * The function expects an object with optional 'state' and 'id' properties.
 *
 * @param obj A readonly and partially optional object with 'state' and 'id' properties.
 * @returns A string concatenating each key-value pair from the object.
 */
export const rollThroughObj = (
	obj: Readonly<Partial<{ state: string; id: string }>>,
): string => {
	// Initialize an empty result string.
	let result = "";

	// Iterate over each entry in the object.
	for (const [key, value] of Object.entries(obj)) {
		// Append the key-value pair to the result string in a formatted way.
		result += ` -${key}: ${value}`;
	}

	// Return the trimmed result.
	return result.trim();
};
