Rename a key in a dictionary and return the result (a new dictionary).
var Dictionaries = require('machinepack-dictionaries');
// Rename a key in a dictionary and return the result (a new dictionary).
Dictionaries.renameKey({
dictionary: {},
originalKey: 'studentName',
newKey: 'studentFullName',
force: true,
}).execSync();
The dictionary to rename the key in.
{}
The key to rename.
'studentName'
A new name for the key.
'studentFullName'
Whether to overwrite an existing key with the same name if there is a conflict.
true
An unexpected error occurred.
The specified key does not exist.
An existing key is already using the specified name for the new key.
OK.