( group: string, version: string, plural: string, namespace?: string, name?: string, )
| 133 | |
| 134 | /** Build the API path for a resource type. */ |
| 135 | export function buildApiPath( |
| 136 | group: string, |
| 137 | version: string, |
| 138 | plural: string, |
| 139 | namespace?: string, |
| 140 | name?: string, |
| 141 | ): string { |
| 142 | const base = |
| 143 | group === "" || group === "core" |
| 144 | ? `/api/${version}` |
| 145 | : `/apis/${group}/${version}`; |
| 146 | const ns = namespace ? `/namespaces/${namespace}` : ""; |
| 147 | const n = name ? `/${name}` : ""; |
| 148 | return `${base}${ns}/${plural}${n}`; |
| 149 | } |
no outgoing calls
no test coverage detected