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

Function decodeUriComponent

packages/effect/src/SchemaGetter.ts:1583–1597  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1581 * @since 4.0.0
1582 */
1583export function decodeUriComponent<E extends string>(): Getter<string, E> {
1584 return transformOrFail((input, options) => {
1585 try {
1586 return Effect.succeed(globalThis.decodeURIComponent(input))
1587 } catch {
1588 return Effect.fail(
1589 new SchemaIssue.InvalidValue(
1590 { expected: "a valid URI component" },
1591 input,
1592 options
1593 )
1594 )
1595 }
1596 })
1597}
1598
1599/**
1600 * Parses a `DateTime.Input` value into a `DateTime.Utc`.

Callers

nothing calls this directly

Calls 3

transformOrFailFunction · 0.70
succeedMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected