MCPcopy Create free account
hub / github.com/Effect-TS/effect / baseUrl

Function baseUrl

packages/platform/src/UrlParams.ts:232–242  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230export const toString = (self: UrlParams): string => new URLSearchParams(self as any).toString()
231
232const baseUrl = (): string | undefined => {
233 if (
234 "location" in globalThis &&
235 globalThis.location !== undefined &&
236 globalThis.location.origin !== undefined &&
237 globalThis.location.pathname !== undefined
238 ) {
239 return location.origin + location.pathname
240 }
241 return undefined
242}
243
244/**
245 * Builds a `Record` containing all the key-value pairs in the given `UrlParams`

Callers 1

makeUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…