feat: enhanced mode supports more fields
This commit is contained in:
14
src/utils/ignore-case.ts
Normal file
14
src/utils/ignore-case.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user