// In this example, we'll be silly, and negate the count of cats, as well as only returning
// their names as a comma separated string.
let kv2 = TypedMutations.KeyValues.fromObject(originalObject).map((value) => {
if(typeof value == "number") {
return -1 * value;
} else {
// Types aren't showcased here, but in TS, we are certain that the type of value is
// {"name": string} due to refinement
return value.map((v) => v.name).join(",")
}
})
kv2.toObject()