Returns a new object with the given function applied to it's keys (shallow). Useful for renaming keys or doing some custom modification.
import { constantCase } from "change-case"const obj = { helloWorld: "hello" }const newObj = changeObjectKeys(obj, constantCase)// newObject = { HELLO_WORLD: "hello" }// newObj must be typed manuallyconst newObj = changeObjectKeys<ResType>(obj, constantCase) Copy
import { constantCase } from "change-case"const obj = { helloWorld: "hello" }const newObj = changeObjectKeys(obj, constantCase)// newObject = { HELLO_WORLD: "hello" }// newObj must be typed manuallyconst newObj = changeObjectKeys<ResType>(obj, constantCase)
Returns a new object with the given function applied to it's keys (shallow). Useful for renaming keys or doing some custom modification.