(dsn: DsnComponents, withPassword: boolean = false)
| 23 | * @param withPassword When set to true, the password will be included. |
| 24 | */ |
| 25 | export function dsnToString(dsn: DsnComponents, withPassword: boolean = false): string { |
| 26 | const { host, path, pass, port, projectId, protocol, publicKey } = dsn; |
| 27 | return ( |
| 28 | `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` + |
| 29 | `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}` |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Parses a Dsn from a given string. |
no outgoing calls
no test coverage detected