//#region src/utils/object.ts
/**
* Rename a key in an object by keeping the element order
*
* @param obj The original object
* @param oldKey The key in the object that needs to be renamed
* @param newKey The new key name to replace the old key
* @returns A new object with the renamed key
*/
const renameKey = (obj, oldKey, newKey) => {
	const newObj = { ...obj };
	for (const key of Object.keys(obj)) if (key === oldKey) {
		newObj[newKey] = obj[oldKey];
		delete newObj[oldKey];
	} else newObj[key] = obj[key];
	return newObj;
};
/**
* Remove a key from an object
*
* @param obj The original object
* @param key The key in the object that needs to be removed
* @returns A new object without the specified key
*/
const removeKey = (obj, key) => {
	const newObj = { ...obj };
	delete newObj[key];
	return newObj;
};

//#endregion
export { removeKey, renameKey };
//# sourceMappingURL=object.mjs.map