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

Function fromString

packages/effect/src/unstable/http/Url.ts:114–119  ·  view source on GitHub ↗
(url, base)

Source from the content-addressed store, hash-verified

112export const fromString: {
113 (url: string, base?: string | URL | undefined): Result.Result<URL, Cause.IllegalArgumentError>
114} = (url, base) =>
115 Result.try({
116 try: () => new URL(url, base),
117 catch: () =>
118 new Cause.IllegalArgumentError(`Invalid URL: "${url}"${base !== undefined ? ` with base "${base}"` : ""}`)
119 })
120
121/**
122 * Updates a cloned `URL` with a callback, allowing multiple changes at once.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected