8 lines
223 B
TypeScript
8 lines
223 B
TypeScript
export const rollThroughObj = (obj: Readonly<Partial<{ state: string; id: string }>>) => {
|
|
let result = "";
|
|
for (const [key, value] of Object.entries(obj)) {
|
|
result += ` -${key}: ${value}`;
|
|
}
|
|
return result.trim();
|
|
};
|