Copy a key in a dictionary and return the result (a new dictionary).
var Dictionaries = require('machinepack-dictionaries');
// Copy a key in a dictionary and return the result (a new dictionary).
Dictionaries.copyKey({
dictionary: {},
originalKey: 'githubUsername',
newKey: 'twitterUsername',
force: true,
}).execSync();
The dictionary where the key will be copied.
{}
The name of the existing key whose value will be copied.
'githubUsername'
A name for the new key.
'twitterUsername'
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.