I'm looking for a way to modify the return type of a function that accepts a generic object. I want the return type to be identical to the object passed in, but narrowed down similar to how `as const` assertions work.
For example, if I call the function with `{ a: "first", b: "second" }`, I want the return type to be `{ a: "first"; b: "second" }` instead of just `{ a: string; b: string }`:
myFn({ a: "first", b: "second" });
Is there a way to instruct the type-checker to narrow down the return type of `myFn` based on its first argument?