(endpoint: WdaEndpoints, params?: Record<string, string>)
| 15 | } |
| 16 | |
| 17 | export const getEndpoint = (endpoint: WdaEndpoints, params?: Record<string, string>): string => { |
| 18 | let endpointStr = endpoint as string; |
| 19 | if (params) { |
| 20 | Object.keys(params).forEach((key) => { |
| 21 | endpointStr = endpointStr.replace(`:${key}`, params[key]); |
| 22 | }); |
| 23 | } |
| 24 | return endpointStr; |
| 25 | }; |