Skip to content
Snippets Groups Projects
Unverified Commit 0a9c8177 authored by GyDi's avatar GyDi
Browse files

fix: change to deep copy

parent c9649ac5
No related branches found
No related tags found
No related merge requests found
// Shallow copy and change all keys to lowercase
// Deep copy and change all keys to lowercase
type TData = Record<string, any>;
export default function ignoreCase(data: TData): TData {
......@@ -6,8 +6,8 @@ export default function ignoreCase(data: TData): TData {
const newData = {} as TData;
Object.keys(data).forEach((key) => {
newData[key.toLowerCase()] = data[key];
Object.entries(data).forEach(([key, value]) => {
newData[key.toLowerCase()] = JSON.parse(JSON.stringify(value));
});
return newData;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment