feat: enhanced mode supports more fields

This commit is contained in:
GyDi
2022-03-27 20:36:13 +08:00
parent bac0d0a175
commit 418951415c
3 changed files with 163 additions and 84 deletions

14
src/utils/ignore-case.ts Normal file
View File

@@ -0,0 +1,14 @@
// 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;
}