mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-14 22:10:32 +08:00
15 lines
310 B
TypeScript
15 lines
310 B
TypeScript
// Shallow 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.keys(data).forEach((key) => {
|
|
newData[key.toLowerCase()] = data[key];
|
|
});
|
|
|
|
return newData;
|
|
}
|