fix: type updates
This commit is contained in:
parent
fc461ed48b
commit
21bb392a19
@ -103,7 +103,7 @@ export const storageImpl: StorageSupport = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
transformInput: async (input: any) => {
|
transformInput: async (input: any): Promise<any> => {
|
||||||
if (Array.isArray(input)) {
|
if (Array.isArray(input)) {
|
||||||
return Promise.all(input.map((item) => storageImpl.transformInput(item)));
|
return Promise.all(input.map((item) => storageImpl.transformInput(item)));
|
||||||
} else if (
|
} else if (
|
||||||
@ -119,9 +119,12 @@ export const storageImpl: StorageSupport = {
|
|||||||
const url = await storageImpl.upload(blob as Blob);
|
const url = await storageImpl.upload(blob as Blob);
|
||||||
return url;
|
return url;
|
||||||
} else if (isPlainObject(input)) {
|
} else if (isPlainObject(input)) {
|
||||||
const promises = Object.entries(input).map(async ([key, value]) => {
|
const inputObject = input as Record<string, any>;
|
||||||
return [key, await storageImpl.transformInput(value)];
|
const promises = Object.entries(inputObject).map(
|
||||||
});
|
async ([key, value]): Promise<KeyValuePair> => {
|
||||||
|
return [key, await storageImpl.transformInput(value)];
|
||||||
|
}
|
||||||
|
);
|
||||||
const results = await Promise.all(promises);
|
const results = await Promise.all(promises);
|
||||||
return Object.fromEntries(results);
|
return Object.fromEntries(results);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user