( value: unknown )
| 37 | } |
| 38 | |
| 39 | export function authConfigHasUsableTokenData( |
| 40 | value: unknown |
| 41 | ): value is Pick<AuthConfig, 'token' | 'refreshToken'> { |
| 42 | if (!value || typeof value !== 'object') { |
| 43 | return false; |
| 44 | } |
| 45 | |
| 46 | const authConfig = value as AuthConfig; |
| 47 | |
| 48 | return ( |
| 49 | (typeof authConfig.token === 'string' && authConfig.token.length > 0) || |
| 50 | (typeof authConfig.refreshToken === 'string' && |
| 51 | authConfig.refreshToken.length > 0) |
| 52 | ); |
| 53 | } |
| 54 | |
| 55 | function getLikelyAutoCredStorage(configDir: string): CredStorage { |
| 56 | try { |
no outgoing calls
no test coverage detected