UNPKG
pb-to-ts-api
Version:
latest (1.0.5)
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
help you transfer protobuf file to your custom d.ts and api request method
pb-to-ts-api
/
src
/
utils
/
getRequestMethod.ts
6 lines
(4 loc)
•
222 B
text/typescript
View Raw
1
2
3
4
5
6
import
{
RequestMethods
}
from
'../interfaces/RequestMethods'
;
export
function
getRequestMethod
(
apiName: string
):
RequestMethods
{
return
/post/
.
test
(apiName.
toLowerCase
()) ?
RequestMethods
.
post
:
RequestMethods
.
get
; }