mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 13:03:44 +08:00
15 lines
341 B
TypeScript
15 lines
341 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 {};
|
|
|
|
const newData = {} as TData;
|
|
|
|
Object.entries(data).forEach(([key, value]) => {
|
|
newData[key.toLowerCase()] = JSON.parse(JSON.stringify(value));
|
|
});
|
|
|
|
return newData;
|
|
}
|