renameKey
renameKey(obj, oldKey, newKey)
renameKey(obj, oldKey, newKey)Description
Arguments
Returns
Example
typescript
import { renameKey } from 'check-engineering/ts-utils';
const person = {
name: 'Alice',
age: 30,
city: 'New York'
};
renameKey(person, 'age', 'years'); // ==> { name: 'Alice', years: 30, city: 'New York' }Usage
Notes
Last updated