mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-06 01:23:45 +08:00
15 lines
343 B
TypeScript
15 lines
343 B
TypeScript
// Deep copy and change all keys to lowercase
|
|
type TData = Record<string, any>;
|
|
|
|
export default function ignoreCase(data: TData): TData {
|
|
if (!data) return data;
|
|
|
|
const newData = {} as TData;
|
|
|
|
Object.entries(data).forEach(([key, value]) => {
|
|
newData[key.toLowerCase()] = JSON.parse(JSON.stringify(value));
|
|
});
|
|
|
|
return newData;
|
|
}
|