( clientOptions: VercelClientOptions )
| 2 | import { VercelClientOptions } from '../types'; |
| 3 | |
| 4 | export function generateQueryString( |
| 5 | clientOptions: VercelClientOptions |
| 6 | ): string { |
| 7 | const options = new URLSearchParams(); |
| 8 | |
| 9 | if (clientOptions.teamId) { |
| 10 | options.set('teamId', clientOptions.teamId); |
| 11 | } |
| 12 | |
| 13 | if (clientOptions.force) { |
| 14 | options.set('forceNew', '1'); |
| 15 | } |
| 16 | |
| 17 | if (clientOptions.withCache) { |
| 18 | options.set('withCache', '1'); |
| 19 | } |
| 20 | |
| 21 | if (clientOptions.skipAutoDetectionConfirmation) { |
| 22 | options.set('skipAutoDetectionConfirmation', '1'); |
| 23 | } |
| 24 | |
| 25 | if (clientOptions.prebuilt) { |
| 26 | options.set('prebuilt', '1'); |
| 27 | } |
| 28 | |
| 29 | return Array.from(options.entries()).length ? `?${options.toString()}` : ''; |
| 30 | } |
no test coverage detected