( param: string | number | boolean, encoding: URLParamsEncodingType, isSpatParam: boolean )
| 48 | } |
| 49 | |
| 50 | export const encodeParam = ( |
| 51 | param: string | number | boolean, |
| 52 | encoding: URLParamsEncodingType, |
| 53 | isSpatParam: boolean |
| 54 | ): string => { |
| 55 | const encoder = |
| 56 | encodingMethods[encoding] || encodeURIComponentExcludingSubDelims |
| 57 | |
| 58 | if (isSpatParam) { |
| 59 | return String(param) |
| 60 | .split('/') |
| 61 | .map(encoder) |
| 62 | .join('/') |
| 63 | } |
| 64 | |
| 65 | return encoder(String(param)) |
| 66 | } |
| 67 | |
| 68 | export const decodeParam = ( |
| 69 | param: string, |
no outgoing calls
no test coverage detected
searching dependent graphs…