mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
9 lines
327 B
JavaScript
9 lines
327 B
JavaScript
import { isFunction, isObject, isString } from './helpers';
|
|
|
|
export default async ({ response, responseDataAdaptor }, next) => {
|
|
if (isFunction(responseDataAdaptor) && response && (isObject(response.data) || isString(response.data))) {
|
|
response.data = responseDataAdaptor(response.data);
|
|
}
|
|
await next();
|
|
};
|