MCPcopy
hub / github.com/Effect-TS/effect / URL$

Class URL$

packages/effect/src/Schema.ts:4930–4950  ·  view source on GitHub ↗

@ignore

Source from the content-addressed store, hash-verified

4928
4929/** @ignore */
4930class URL$ extends transformOrFail(
4931 String$.annotations({ description: "a string to be decoded into a URL" }),
4932 URLFromSelf,
4933 {
4934 strict: true,
4935 decode: (i, _, ast) =>
4936 ParseResult.try({
4937 try: () => new URL(i),
4938 catch: (e) =>
4939 new ParseResult.Type(
4940 ast,
4941 i,
4942 `Unable to decode ${JSON.stringify(i)} into a URL. ${getErrorMessage(e)}`
4943 )
4944 }),
4945 encode: (a) => ParseResult.succeed(a.toString())
4946 }
4947).annotations({
4948 identifier: "URL",
4949 pretty: () => (url) => url.toString()
4950}) {}
4951
4952export {
4953 /**

Callers

nothing calls this directly

Calls 4

transformOrFailInterface · 0.85
getErrorMessageFunction · 0.70
annotationsMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected