File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { HttpProxyAgent, HttpsProxyAgent } from 'hpagent'
33import isInteractive from '@socketregistry/is-interactive/index.cjs'
44import { password } from '@socketsecurity/registry/lib/prompts'
55import { isNonEmptyString } from '@socketsecurity/registry/lib/strings'
6+ import { isUrl } from '@socketsecurity/registry/lib/url'
67import { SocketSdk , createUserAgentFromPkgJson } from '@socketsecurity/sdk'
78
89import { getConfigValueOrUndef } from './config.mts'
@@ -30,17 +31,6 @@ export function getDefaultProxyUrl(): string | undefined {
3031 return isUrl ( apiProxy ) ? apiProxy : undefined
3132}
3233
33- function isUrl ( value : any ) : value is string {
34- if ( isNonEmptyString ( value ) ) {
35- try {
36- // eslint-disable-next-line no-new
37- new URL ( value )
38- return true
39- } catch { }
40- }
41- return false
42- }
43-
4434// This Socket API token should be stored globally for the duration of the CLI execution.
4535let _defaultToken : string | undefined
4636export function getDefaultApiToken ( ) : string | undefined {
You can’t perform that action at this time.
0 commit comments