axios-miniprogram/src/core/transformMethod.ts

20 lines
461 B
TypeScript
Raw Normal View History

2020-04-20 22:33:15 +08:00
import { AliasMethod, AdapterMethod, Method } from '../types';
/**
*
*
* @param config Axios
*/
export function methodToLowercase(method: Method = 'get'): AliasMethod {
return method.toLowerCase() as AliasMethod;
}
/**
*
*
* @param config Axios
*/
export function methodToUppercase(method: Method = 'GET'): AdapterMethod {
return method.toUpperCase() as AdapterMethod;
}